From 303058f492ae2a19cc30e9603ec544a252a6d192 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 11 Mar 2013 23:33:47 -0700 Subject: [PATCH] Quick and dirty Windows UI for memchecks. --- Windows/Debugger/Debugger_Disasm.cpp | 32 ++++++++++++++++++++++++++++ Windows/ppsspp.rc | 1 + Windows/resource.h | 3 ++- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Windows/Debugger/Debugger_Disasm.cpp b/Windows/Debugger/Debugger_Disasm.cpp index 7f0d044c5d..c27d2f09b2 100644 --- a/Windows/Debugger/Debugger_Disasm.cpp +++ b/Windows/Debugger/Debugger_Disasm.cpp @@ -2,6 +2,7 @@ #include "../../Core/MemMap.h" #include "../Resource.h" +#include "../InputBox.h" #include "../../Core/Debugger/Breakpoints.h" #include "../../Core/Debugger/SymbolMap.h" @@ -234,6 +235,37 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) } break; + case IDC_MEMCHECK: + { + bool isRunning = !Core_IsInactive(); + if (isRunning) + { + SetDebugMode(true); + Core_EnableStepping(true); + Core_WaitInactive(200); + } + + MemCheck check; + if (InputBox_GetHex(GetModuleHandle(NULL), m_hDlg, "JIT (and not HLE) only for now, no delete", 0, check.iStartAddress)) + { + check.bBreak = true; + check.bLog = true; + check.bOnRead = true; + check.bOnWrite = true; + check.bRange = false; + CBreakPoints::MemChecks.push_back(check); + CBreakPoints::InvalidateJit(); + } + + if (isRunning) + { + SetDebugMode(false); + Core_EnableStepping(false); + MainWindow::UpdateMenus(); + } + } + break; + case IDC_ADDRESS: { if (HIWORD(wParam) == EN_CHANGE ) diff --git a/Windows/ppsspp.rc b/Windows/ppsspp.rc index 2b8e64d5af..e6c03b1373 100644 --- a/Windows/ppsspp.rc +++ b/Windows/ppsspp.rc @@ -28,6 +28,7 @@ BEGIN PUSHBUTTON "Step &Over",IDC_STEPOVER,219,0,40,14 PUSHBUTTON "S&kip",IDC_SKIP,265,0,23,14 PUSHBUTTON "Next &HLE",IDC_STEPHLE,294,0,40,14 + PUSHBUTTON "&Memcheck",IDC_MEMCHECK,340,0,40,14 EDITTEXT IDC_ADDRESS,11,24,91,13,ES_UPPERCASE | ES_AUTOHSCROLL PUSHBUTTON "&PC",IDC_GOTOPC,11,40,15,13 PUSHBUTTON "&LR",IDC_GOTOLR,28,40,14,13 diff --git a/Windows/resource.h b/Windows/resource.h index 648ac65b01..ce9a50b2ea 100644 --- a/Windows/resource.h +++ b/Windows/resource.h @@ -262,6 +262,7 @@ #define ID_OPTIONS_SHOWFPS 40137 #define ID_OPTIONS_STRETCHDISPLAY 40138 #define ID_OPTIONS_FRAMESKIP 40139 +#define IDC_MEMCHECK 40140 #define IDC_STATIC -1 // Next default values for new objects @@ -269,7 +270,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 233 -#define _APS_NEXT_COMMAND_VALUE 40140 +#define _APS_NEXT_COMMAND_VALUE 40141 #define _APS_NEXT_CONTROL_VALUE 1163 #define _APS_NEXT_SYMED_VALUE 101 #endif