From b78f74a3f41688b0472be29d4d2205b1fc7c7e36 Mon Sep 17 00:00:00 2001 From: Kingcom Date: Sat, 29 Jun 2013 15:57:41 +0200 Subject: [PATCH] More changes --- Windows/Debugger/CtrlDisAsmView.cpp | 3 ++- Windows/Debugger/Debugger_Disasm.cpp | 24 ++++++++++++++++++------ Windows/Debugger/Debugger_MemoryDlg.cpp | 19 +++++++++++++++---- Windows/Debugger/ExpressionParser.cpp | 6 ++++++ Windows/ppsspp.rc | Bin 40342 -> 40344 bytes 5 files changed, 41 insertions(+), 11 deletions(-) diff --git a/Windows/Debugger/CtrlDisAsmView.cpp b/Windows/Debugger/CtrlDisAsmView.cpp index 1c869d63a7..0dd72a1f0f 100644 --- a/Windows/Debugger/CtrlDisAsmView.cpp +++ b/Windows/Debugger/CtrlDisAsmView.cpp @@ -9,6 +9,7 @@ #include "CtrlDisAsmView.h" #include "Debugger_MemoryDlg.h" +#include "ExpressionParser.h" #include "../../Core/Debugger/SymbolMap.h" #include "../../globals.h" #include "../main.h" @@ -812,7 +813,7 @@ void CtrlDisAsmView::disassembleToFile() u32 size; // get size - if (InputBox_GetHex(MainWindow::GetHInstance(), MainWindow::GetHWND(), "Size in hex",0,size) == false) return; + if (executeExpressionWindow(wnd,debugger,size) == false) return; if (size == 0 || size > 10*1024*1024) { MessageBox(wnd,"Invalid size!","Error",MB_OK); diff --git a/Windows/Debugger/Debugger_Disasm.cpp b/Windows/Debugger/Debugger_Disasm.cpp index aea6477d2a..1ab6ad1f01 100644 --- a/Windows/Debugger/Debugger_Disasm.cpp +++ b/Windows/Debugger/Debugger_Disasm.cpp @@ -73,17 +73,28 @@ LRESULT CALLBACK GotoEditProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa { switch(message) { - case WM_KEYUP: + case WM_KEYDOWN: if( wParam == VK_RETURN ) { SendMessage(GetParent(hDlg),WM_USER+6,0,0); return 0; } - default: - return (LRESULT)CallWindowProc((WNDPROC)DefGotoEditProc,hDlg,message,wParam,lParam); + break; + case WM_KEYUP: + if( wParam == VK_RETURN ) return 0; + break; + case WM_CHAR: + if( wParam == VK_RETURN ) return 0; + break; + case WM_GETDLGCODE: + if (lParam && ((MSG*)lParam)->message == WM_KEYDOWN) + { + if (wParam == VK_RETURN) return DLGC_WANTMESSAGE; + } + break; }; - return 0; + return (LRESULT)CallWindowProc((WNDPROC)DefGotoEditProc,hDlg,message,wParam,lParam); } @@ -141,7 +152,7 @@ CDisasm::CDisasm(HINSTANCE _hInstance, HWND _hParent, DebugInterface *_cpu) : Di // subclass the goto edit box HWND editWnd = GetDlgItem(m_hDlg,IDC_ADDRESS); DefGotoEditProc = (WNDPROC)GetWindowLongPtr(editWnd,GWLP_WNDPROC); - SetWindowLongPtr(editWnd,GWLP_WNDPROC,(LONG_PTR)DefGotoEditProc); + SetWindowLongPtr(editWnd,GWLP_WNDPROC,(LONG_PTR)GotoEditProc); // subclass the breakpoint list HWND breakpointHwnd = GetDlgItem(m_hDlg, IDC_BREAKPOINTLIST); @@ -713,9 +724,10 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) u32 addr; if (parseExpression(szBuffer,cpu,addr) == false) { - displayExpressionError(m_hDlg); + displayExpressionError(GetDlgItem(m_hDlg,IDC_ADDRESS)); } else { ptr->gotoAddr(addr); + SetFocus(GetDlgItem(m_hDlg, IDC_DISASMVIEW)); } UpdateDialog(); } diff --git a/Windows/Debugger/Debugger_MemoryDlg.cpp b/Windows/Debugger/Debugger_MemoryDlg.cpp index 6ea1985578..87a24bacc7 100644 --- a/Windows/Debugger/Debugger_MemoryDlg.cpp +++ b/Windows/Debugger/Debugger_MemoryDlg.cpp @@ -21,17 +21,27 @@ LRESULT CALLBACK AddressEditProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM { switch(message) { - case WM_KEYUP: + case WM_KEYDOWN: if( wParam == VK_RETURN ) { SendMessage(AddressEditParentHwnd,WM_USER+2,0,0); return 0; } - default: - return (LRESULT)CallWindowProc((WNDPROC)DefAddressEditProc,hDlg,message,wParam,lParam); + case WM_KEYUP: + if( wParam == VK_RETURN ) return 0; + break; + case WM_CHAR: + if( wParam == VK_RETURN ) return 0; + break; + case WM_GETDLGCODE: + if (lParam && ((MSG*)lParam)->message == WM_KEYDOWN) + { + if (wParam == VK_RETURN) return DLGC_WANTMESSAGE; + } + break; }; - return 0; + return (LRESULT)CallWindowProc((WNDPROC)DefAddressEditProc,hDlg,message,wParam,lParam); } @@ -163,6 +173,7 @@ BOOL CMemoryDlg::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) displayExpressionError(m_hDlg); } else { mv->gotoAddr(addr); + SetFocus(GetDlgItem(m_hDlg,IDC_MEMVIEW)); } break; } diff --git a/Windows/Debugger/ExpressionParser.cpp b/Windows/Debugger/ExpressionParser.cpp index f0eaa50fdb..fab99502bb 100644 --- a/Windows/Debugger/ExpressionParser.cpp +++ b/Windows/Debugger/ExpressionParser.cpp @@ -160,6 +160,12 @@ bool parseLabel(char* label, DebugInterface* debug, u32& dest) } } + if (stricmp(label,"pc") == 0) + { + dest = debug->GetPC(); + return true; + } + // now check labels return debug->getSymbolValue(label,dest); } diff --git a/Windows/ppsspp.rc b/Windows/ppsspp.rc index ea95ee62bce66e456a7377afaa912f3bb62093ec..8840dfd88306948a63100b4405ac1979ede42d8b 100644 GIT binary patch delta 57 zcmbQXn`y>wrVZPaCl{zHZN8zL#5B3WT}INCA($baA)LXH!H*$?A&9{hNQMGwzsVQX L3^&hH`%wk}9{>@? delta 35 tcmV+;0NnqWy8@QG0