From 96328902a53734c0ec5482d4e8b935f71784f88b Mon Sep 17 00:00:00 2001 From: lioncash Date: Mon, 3 Mar 2014 13:56:28 -0500 Subject: [PATCH 1/3] Actually make PPCDebugInterface::ClearAllBreakpoints have functionality. Fairly simple - just clear the breakpoints. --- Source/Core/Core/Debugger/PPCDebugInterface.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/Debugger/PPCDebugInterface.cpp b/Source/Core/Core/Debugger/PPCDebugInterface.cpp index 8674564945..131ff307bf 100644 --- a/Source/Core/Core/Debugger/PPCDebugInterface.cpp +++ b/Source/Core/Core/Debugger/PPCDebugInterface.cpp @@ -108,7 +108,10 @@ void PPCDebugInterface::ClearBreakpoint(unsigned int address) PowerPC::breakpoints.Remove(address); } -void PPCDebugInterface::ClearAllBreakpoints() {} +void PPCDebugInterface::ClearAllBreakpoints() +{ + PowerPC::breakpoints.Clear(); +} void PPCDebugInterface::ToggleBreakpoint(unsigned int address) { From 610a6f9b23e7cc2b9553781f24ede40633c0ab3e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 5 Mar 2014 20:51:27 -0500 Subject: [PATCH 2/3] Add ClearAllMemChecks to DebugInterface Breakpoints have one, but memchecks don't, despite being cleared directly in the breakpoint window. Now DolphinWX should call the interface functions and not the direct functions of the breakpoints or memchecks for clearing. --- Source/Core/Common/DebugInterface.h | 1 + Source/Core/Core/Debugger/PPCDebugInterface.cpp | 5 +++++ Source/Core/Core/Debugger/PPCDebugInterface.h | 1 + Source/Core/Core/HW/DSPLLE/DSPDebugInterface.cpp | 5 +++++ Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h | 1 + Source/Core/DolphinWX/Debugger/BreakpointWindow.cpp | 5 +++-- 6 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Source/Core/Common/DebugInterface.h b/Source/Core/Common/DebugInterface.h index 0bd9c29beb..26e0a3e2ee 100644 --- a/Source/Core/Common/DebugInterface.h +++ b/Source/Core/Common/DebugInterface.h @@ -18,6 +18,7 @@ public: virtual void ClearBreakpoint(unsigned int /*address*/){} virtual void ClearAllBreakpoints() {} virtual void ToggleBreakpoint(unsigned int /*address*/){} + virtual void ClearAllMemChecks() {} virtual bool IsMemCheck(unsigned int /*address*/) {return false;} virtual void ToggleMemCheck(unsigned int /*address*/){} virtual unsigned int ReadMemory(unsigned int /*address*/){return 0;} diff --git a/Source/Core/Core/Debugger/PPCDebugInterface.cpp b/Source/Core/Core/Debugger/PPCDebugInterface.cpp index 131ff307bf..0d34a56f0a 100644 --- a/Source/Core/Core/Debugger/PPCDebugInterface.cpp +++ b/Source/Core/Core/Debugger/PPCDebugInterface.cpp @@ -121,6 +121,11 @@ void PPCDebugInterface::ToggleBreakpoint(unsigned int address) PowerPC::breakpoints.Add(address); } +void PPCDebugInterface::ClearAllMemChecks() +{ + PowerPC::memchecks.Clear(); +} + bool PPCDebugInterface::IsMemCheck(unsigned int address) { return (Memory::AreMemoryBreakpointsActivated() diff --git a/Source/Core/Core/Debugger/PPCDebugInterface.h b/Source/Core/Core/Debugger/PPCDebugInterface.h index bd4cd42bf5..fbd01e06af 100644 --- a/Source/Core/Core/Debugger/PPCDebugInterface.h +++ b/Source/Core/Core/Debugger/PPCDebugInterface.h @@ -23,6 +23,7 @@ public: virtual void ClearBreakpoint(unsigned int address) override; virtual void ClearAllBreakpoints() override; virtual void ToggleBreakpoint(unsigned int address) override; + virtual void ClearAllMemChecks() override; virtual bool IsMemCheck(unsigned int address) override; virtual void ToggleMemCheck(unsigned int address) override; virtual unsigned int ReadMemory(unsigned int address) override; diff --git a/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.cpp b/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.cpp index e9aba0fd15..863daf7a05 100644 --- a/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.cpp +++ b/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.cpp @@ -127,6 +127,11 @@ bool DSPDebugInterface::IsMemCheck(unsigned int address) return false; } +void DSPDebugInterface::ClearAllMemChecks() +{ + PanicAlert("MemCheck functionality not supported in DSP module."); +} + void DSPDebugInterface::ToggleMemCheck(unsigned int address) { PanicAlert("MemCheck functionality not supported in DSP module."); diff --git a/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h b/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h index c406120c3f..7e3a6efabc 100644 --- a/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h +++ b/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h @@ -23,6 +23,7 @@ public: virtual void ClearBreakpoint(unsigned int address); virtual void ClearAllBreakpoints(); virtual void ToggleBreakpoint(unsigned int address); + virtual void ClearAllMemChecks(); virtual bool IsMemCheck(unsigned int address); virtual void ToggleMemCheck(unsigned int address); virtual unsigned int ReadMemory(unsigned int address); diff --git a/Source/Core/DolphinWX/Debugger/BreakpointWindow.cpp b/Source/Core/DolphinWX/Debugger/BreakpointWindow.cpp index b16f150d74..b650ac2655 100644 --- a/Source/Core/DolphinWX/Debugger/BreakpointWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/BreakpointWindow.cpp @@ -153,8 +153,9 @@ void CBreakPointWindow::OnSelectBP(wxListEvent& event) // Clear all breakpoints and memchecks void CBreakPointWindow::OnClear(wxCommandEvent& WXUNUSED(event)) { - PowerPC::breakpoints.Clear(); - PowerPC::memchecks.Clear(); + PowerPC::debug_interface.ClearAllBreakpoints(); + PowerPC::debug_interface.ClearAllMemChecks(); + NotifyUpdate(); } From aa82680be7db557bc40f4b76fe96c47f14c38960 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 5 Mar 2014 21:54:34 -0500 Subject: [PATCH 3/3] Mark functions in the PPCDebugInterface and DSPDebugInterface as final. The way they currently were, they would allow for a class to inherit and override these interfaces functions. However, this doesn't make sense conceptually. --- Source/Core/Core/Debugger/PPCDebugInterface.h | 48 +++++++++---------- .../Core/Core/HW/DSPLLE/DSPDebugInterface.h | 42 ++++++++-------- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/Source/Core/Core/Debugger/PPCDebugInterface.h b/Source/Core/Core/Debugger/PPCDebugInterface.h index fbd01e06af..c774d26b5b 100644 --- a/Source/Core/Core/Debugger/PPCDebugInterface.h +++ b/Source/Core/Core/Debugger/PPCDebugInterface.h @@ -14,32 +14,32 @@ class PPCDebugInterface : public DebugInterface { public: PPCDebugInterface(){} - virtual void Disassemble(unsigned int address, char *dest, int max_size) override; - virtual void GetRawMemoryString(int memory, unsigned int address, char *dest, int max_size) override; - virtual int GetInstructionSize(int /*instruction*/) override {return 4;} - virtual bool IsAlive() override; - virtual bool IsBreakpoint(unsigned int address) override; - virtual void SetBreakpoint(unsigned int address) override; - virtual void ClearBreakpoint(unsigned int address) override; - virtual void ClearAllBreakpoints() override; - virtual void ToggleBreakpoint(unsigned int address) override; - virtual void ClearAllMemChecks() override; - virtual bool IsMemCheck(unsigned int address) override; - virtual void ToggleMemCheck(unsigned int address) override; - virtual unsigned int ReadMemory(unsigned int address) override; + virtual void Disassemble(unsigned int address, char *dest, int max_size) final; + virtual void GetRawMemoryString(int memory, unsigned int address, char *dest, int max_size) final; + virtual int GetInstructionSize(int /*instruction*/) final {return 4;} + virtual bool IsAlive() final; + virtual bool IsBreakpoint(unsigned int address) final; + virtual void SetBreakpoint(unsigned int address) final; + virtual void ClearBreakpoint(unsigned int address) final; + virtual void ClearAllBreakpoints() final; + virtual void ToggleBreakpoint(unsigned int address) final; + virtual void ClearAllMemChecks() final; + virtual bool IsMemCheck(unsigned int address) final; + virtual void ToggleMemCheck(unsigned int address) final; + virtual unsigned int ReadMemory(unsigned int address) final; enum { EXTRAMEM_ARAM = 1, }; - virtual unsigned int ReadExtraMemory(int memory, unsigned int address) override; - virtual unsigned int ReadInstruction(unsigned int address) override; - virtual unsigned int GetPC() override; - virtual void SetPC(unsigned int address) override; - virtual void Step() override {} - virtual void BreakNow() override; - virtual void RunToBreakpoint() override; - virtual void InsertBLR(unsigned int address, unsigned int value) override; - virtual int GetColor(unsigned int address) override; - virtual std::string GetDescription(unsigned int address) override; - virtual void ShowJitResults(u32 address) override; + virtual unsigned int ReadExtraMemory(int memory, unsigned int address) final; + virtual unsigned int ReadInstruction(unsigned int address) final; + virtual unsigned int GetPC() final; + virtual void SetPC(unsigned int address) final; + virtual void Step() final {} + virtual void BreakNow() final; + virtual void RunToBreakpoint() final; + virtual void InsertBLR(unsigned int address, unsigned int value) final; + virtual int GetColor(unsigned int address) final; + virtual std::string GetDescription(unsigned int address) final; + virtual void ShowJitResults(u32 address) final; }; diff --git a/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h b/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h index 7e3a6efabc..4dd12156d3 100644 --- a/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h +++ b/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h @@ -14,25 +14,25 @@ class DSPDebugInterface : public DebugInterface { public: DSPDebugInterface(){} - virtual void Disassemble(unsigned int address, char *dest, int max_size); - virtual void GetRawMemoryString(int memory, unsigned int address, char *dest, int max_size); - virtual int GetInstructionSize(int instruction) {return 1;} - virtual bool IsAlive(); - virtual bool IsBreakpoint(unsigned int address); - virtual void SetBreakpoint(unsigned int address); - virtual void ClearBreakpoint(unsigned int address); - virtual void ClearAllBreakpoints(); - virtual void ToggleBreakpoint(unsigned int address); - virtual void ClearAllMemChecks(); - virtual bool IsMemCheck(unsigned int address); - virtual void ToggleMemCheck(unsigned int address); - virtual unsigned int ReadMemory(unsigned int address); - virtual unsigned int ReadInstruction(unsigned int address); - virtual unsigned int GetPC(); - virtual void SetPC(unsigned int address); - virtual void Step() {} - virtual void RunToBreakpoint(); - virtual void InsertBLR(unsigned int address, unsigned int value); - virtual int GetColor(unsigned int address); - virtual std::string GetDescription(unsigned int address); + virtual void Disassemble(unsigned int address, char *dest, int max_size) final; + virtual void GetRawMemoryString(int memory, unsigned int address, char *dest, int max_size) final; + virtual int GetInstructionSize(int instruction) final {return 1;} + virtual bool IsAlive() final; + virtual bool IsBreakpoint(unsigned int address) final; + virtual void SetBreakpoint(unsigned int address) final; + virtual void ClearBreakpoint(unsigned int address) final; + virtual void ClearAllBreakpoints() final; + virtual void ToggleBreakpoint(unsigned int address) final; + virtual void ClearAllMemChecks() final; + virtual bool IsMemCheck(unsigned int address) final; + virtual void ToggleMemCheck(unsigned int address) final; + virtual unsigned int ReadMemory(unsigned int address) final; + virtual unsigned int ReadInstruction(unsigned int address) final; + virtual unsigned int GetPC() final; + virtual void SetPC(unsigned int address) final; + virtual void Step() final {} + virtual void RunToBreakpoint() final; + virtual void InsertBLR(unsigned int address, unsigned int value) final; + virtual int GetColor(unsigned int address) final; + virtual std::string GetDescription(unsigned int address) final; };