mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 09:39:33 +01:00
Expression parser
This commit is contained in:
1 parent
88b9fa7345
commit
ab1aa09dce
13 files changed
+577
-21
No files matched your search
@@ -10,6 +10,7 @@
|
||||
#include "Debugger_MemoryDlg.h"
|
||||
#include "Debugger_Disasm.h"
|
||||
#include "Debugger_VFPUDlg.h"
|
||||
#include "ExpressionParser.h"
|
||||
|
||||
#include "../main.h"
|
||||
#include "CtrlRegisterList.h"
|
||||
@@ -66,6 +67,24 @@ static LRESULT CALLBACK BreakpointListProc(HWND hDlg, UINT message, WPARAM wPara
|
||||
|
||||
|
||||
|
||||
FAR WNDPROC DefGotoEditProc;
|
||||
|
||||
LRESULT CALLBACK GotoEditProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch(message)
|
||||
{
|
||||
case WM_KEYUP:
|
||||
if( wParam == VK_RETURN )
|
||||
{
|
||||
SendMessage(GetParent(hDlg),WM_USER+6,0,0);
|
||||
return 0;
|
||||
}
|
||||
default:
|
||||
return (LRESULT)CallWindowProc((WNDPROC)DefGotoEditProc,hDlg,message,wParam,lParam);
|
||||
};
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
CDisasm::CDisasm(HINSTANCE _hInstance, HWND _hParent, DebugInterface *_cpu) : Dialog((LPCSTR)IDD_DISASM, _hInstance, _hParent)
|
||||
@@ -124,7 +143,11 @@ CDisasm::CDisasm(HINSTANCE _hInstance, HWND _hParent, DebugInterface *_cpu) : Di
|
||||
ShowWindow(GetDlgItem(m_hDlg, IDC_REGLIST), SW_NORMAL);
|
||||
ShowWindow(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST), SW_HIDE);
|
||||
SetTimer(m_hDlg,1,1000,0);
|
||||
|
||||
|
||||
// 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);
|
||||
|
||||
// subclass the breakpoint list
|
||||
HWND breakpointHwnd = GetDlgItem(m_hDlg, IDC_BREAKPOINTLIST);
|
||||
@@ -147,7 +170,6 @@ CDisasm::CDisasm(HINSTANCE _hInstance, HWND _hParent, DebugInterface *_cpu) : Di
|
||||
ListView_InsertColumn(breakpointHwnd, i, &lvc);
|
||||
}
|
||||
|
||||
|
||||
// Actually resize the window to the proper size (after the above setup.)
|
||||
if (w != -1 && h != -1)
|
||||
{
|
||||
@@ -584,7 +606,8 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
|
||||
MemCheck check;
|
||||
if (InputBox_GetHex(GetModuleHandle(NULL), m_hDlg, "JIT (and not HLE) only for now, no delete", 0, check.iStartAddress))
|
||||
|
||||
if (executeExpressionWindow(m_hDlg,cpu,check.iStartAddress))
|
||||
{
|
||||
check.bBreak = true;
|
||||
check.bLog = true;
|
||||
@@ -603,19 +626,6 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_ADDRESS:
|
||||
{
|
||||
if (HIWORD(wParam) == EN_CHANGE )
|
||||
{
|
||||
char szBuffer[32];
|
||||
GetWindowText ((HWND)lParam, szBuffer, 32);
|
||||
ptr->gotoAddr(parseHex(szBuffer));
|
||||
UpdateDialog();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_UPDATECALLSTACK:
|
||||
{
|
||||
HWND hDlg = m_hDlg;
|
||||
@@ -700,6 +710,22 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
case WM_USER+5:
|
||||
removeBreakpoint(wParam);
|
||||
break;
|
||||
case WM_USER+6: // goto edit
|
||||
{
|
||||
char szBuffer[256];
|
||||
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
|
||||
GetWindowText(GetDlgItem(m_hDlg,IDC_ADDRESS),szBuffer,256);
|
||||
|
||||
u32 addr;
|
||||
if (parseExpression(szBuffer,cpu,addr) == false)
|
||||
{
|
||||
displayExpressionError(m_hDlg);
|
||||
} else {
|
||||
ptr->gotoAddr(addr);
|
||||
}
|
||||
UpdateDialog();
|
||||
}
|
||||
break;
|
||||
case WM_SIZE:
|
||||
{
|
||||
UpdateSize(LOWORD(lParam), HIWORD(lParam));
|
||||
|
||||
Reference in new issue
Block a user