Merge pull request #130 from lioncash/breakpoint-clear

Actually make PPCDebugInterface::ClearAllBreakpoints have functionality.
This commit is contained in:
Pierre Bourdon 2014-03-07 20:42:52 +01:00
commit 248f5d7f22
6 changed files with 63 additions and 46 deletions

View File

@ -18,6 +18,7 @@ public:
virtual void ClearBreakpoint(unsigned int /*address*/){} virtual void ClearBreakpoint(unsigned int /*address*/){}
virtual void ClearAllBreakpoints() {} virtual void ClearAllBreakpoints() {}
virtual void ToggleBreakpoint(unsigned int /*address*/){} virtual void ToggleBreakpoint(unsigned int /*address*/){}
virtual void ClearAllMemChecks() {}
virtual bool IsMemCheck(unsigned int /*address*/) {return false;} virtual bool IsMemCheck(unsigned int /*address*/) {return false;}
virtual void ToggleMemCheck(unsigned int /*address*/){} virtual void ToggleMemCheck(unsigned int /*address*/){}
virtual unsigned int ReadMemory(unsigned int /*address*/){return 0;} virtual unsigned int ReadMemory(unsigned int /*address*/){return 0;}

View File

@ -108,7 +108,10 @@ void PPCDebugInterface::ClearBreakpoint(unsigned int address)
PowerPC::breakpoints.Remove(address); PowerPC::breakpoints.Remove(address);
} }
void PPCDebugInterface::ClearAllBreakpoints() {} void PPCDebugInterface::ClearAllBreakpoints()
{
PowerPC::breakpoints.Clear();
}
void PPCDebugInterface::ToggleBreakpoint(unsigned int address) void PPCDebugInterface::ToggleBreakpoint(unsigned int address)
{ {
@ -118,6 +121,11 @@ void PPCDebugInterface::ToggleBreakpoint(unsigned int address)
PowerPC::breakpoints.Add(address); PowerPC::breakpoints.Add(address);
} }
void PPCDebugInterface::ClearAllMemChecks()
{
PowerPC::memchecks.Clear();
}
bool PPCDebugInterface::IsMemCheck(unsigned int address) bool PPCDebugInterface::IsMemCheck(unsigned int address)
{ {
return (Memory::AreMemoryBreakpointsActivated() return (Memory::AreMemoryBreakpointsActivated()

View File

@ -14,31 +14,32 @@ class PPCDebugInterface : public DebugInterface
{ {
public: public:
PPCDebugInterface(){} PPCDebugInterface(){}
virtual void Disassemble(unsigned int address, char *dest, int max_size) 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) override; virtual void GetRawMemoryString(int memory, unsigned int address, char *dest, int max_size) final;
virtual int GetInstructionSize(int /*instruction*/) override {return 4;} virtual int GetInstructionSize(int /*instruction*/) final {return 4;}
virtual bool IsAlive() override; virtual bool IsAlive() final;
virtual bool IsBreakpoint(unsigned int address) override; virtual bool IsBreakpoint(unsigned int address) final;
virtual void SetBreakpoint(unsigned int address) override; virtual void SetBreakpoint(unsigned int address) final;
virtual void ClearBreakpoint(unsigned int address) override; virtual void ClearBreakpoint(unsigned int address) final;
virtual void ClearAllBreakpoints() override; virtual void ClearAllBreakpoints() final;
virtual void ToggleBreakpoint(unsigned int address) override; virtual void ToggleBreakpoint(unsigned int address) final;
virtual bool IsMemCheck(unsigned int address) override; virtual void ClearAllMemChecks() final;
virtual void ToggleMemCheck(unsigned int address) override; virtual bool IsMemCheck(unsigned int address) final;
virtual unsigned int ReadMemory(unsigned int address) override; virtual void ToggleMemCheck(unsigned int address) final;
virtual unsigned int ReadMemory(unsigned int address) final;
enum { enum {
EXTRAMEM_ARAM = 1, EXTRAMEM_ARAM = 1,
}; };
virtual unsigned int ReadExtraMemory(int memory, unsigned int address) override; virtual unsigned int ReadExtraMemory(int memory, unsigned int address) final;
virtual unsigned int ReadInstruction(unsigned int address) override; virtual unsigned int ReadInstruction(unsigned int address) final;
virtual unsigned int GetPC() override; virtual unsigned int GetPC() final;
virtual void SetPC(unsigned int address) override; virtual void SetPC(unsigned int address) final;
virtual void Step() override {} virtual void Step() final {}
virtual void BreakNow() override; virtual void BreakNow() final;
virtual void RunToBreakpoint() override; virtual void RunToBreakpoint() final;
virtual void InsertBLR(unsigned int address, unsigned int value) override; virtual void InsertBLR(unsigned int address, unsigned int value) final;
virtual int GetColor(unsigned int address) override; virtual int GetColor(unsigned int address) final;
virtual std::string GetDescription(unsigned int address) override; virtual std::string GetDescription(unsigned int address) final;
virtual void ShowJitResults(u32 address) override; virtual void ShowJitResults(u32 address) final;
}; };

View File

@ -127,6 +127,11 @@ bool DSPDebugInterface::IsMemCheck(unsigned int address)
return false; return false;
} }
void DSPDebugInterface::ClearAllMemChecks()
{
PanicAlert("MemCheck functionality not supported in DSP module.");
}
void DSPDebugInterface::ToggleMemCheck(unsigned int address) void DSPDebugInterface::ToggleMemCheck(unsigned int address)
{ {
PanicAlert("MemCheck functionality not supported in DSP module."); PanicAlert("MemCheck functionality not supported in DSP module.");

View File

@ -14,24 +14,25 @@ class DSPDebugInterface : public DebugInterface
{ {
public: public:
DSPDebugInterface(){} DSPDebugInterface(){}
virtual void Disassemble(unsigned int address, char *dest, int max_size); 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); virtual void GetRawMemoryString(int memory, unsigned int address, char *dest, int max_size) final;
virtual int GetInstructionSize(int instruction) {return 1;} virtual int GetInstructionSize(int instruction) final {return 1;}
virtual bool IsAlive(); virtual bool IsAlive() final;
virtual bool IsBreakpoint(unsigned int address); virtual bool IsBreakpoint(unsigned int address) final;
virtual void SetBreakpoint(unsigned int address); virtual void SetBreakpoint(unsigned int address) final;
virtual void ClearBreakpoint(unsigned int address); virtual void ClearBreakpoint(unsigned int address) final;
virtual void ClearAllBreakpoints(); virtual void ClearAllBreakpoints() final;
virtual void ToggleBreakpoint(unsigned int address); virtual void ToggleBreakpoint(unsigned int address) final;
virtual bool IsMemCheck(unsigned int address); virtual void ClearAllMemChecks() final;
virtual void ToggleMemCheck(unsigned int address); virtual bool IsMemCheck(unsigned int address) final;
virtual unsigned int ReadMemory(unsigned int address); virtual void ToggleMemCheck(unsigned int address) final;
virtual unsigned int ReadInstruction(unsigned int address); virtual unsigned int ReadMemory(unsigned int address) final;
virtual unsigned int GetPC(); virtual unsigned int ReadInstruction(unsigned int address) final;
virtual void SetPC(unsigned int address); virtual unsigned int GetPC() final;
virtual void Step() {} virtual void SetPC(unsigned int address) final;
virtual void RunToBreakpoint(); virtual void Step() final {}
virtual void InsertBLR(unsigned int address, unsigned int value); virtual void RunToBreakpoint() final;
virtual int GetColor(unsigned int address); virtual void InsertBLR(unsigned int address, unsigned int value) final;
virtual std::string GetDescription(unsigned int address); virtual int GetColor(unsigned int address) final;
virtual std::string GetDescription(unsigned int address) final;
}; };

View File

@ -153,8 +153,9 @@ void CBreakPointWindow::OnSelectBP(wxListEvent& event)
// Clear all breakpoints and memchecks // Clear all breakpoints and memchecks
void CBreakPointWindow::OnClear(wxCommandEvent& WXUNUSED(event)) void CBreakPointWindow::OnClear(wxCommandEvent& WXUNUSED(event))
{ {
PowerPC::breakpoints.Clear(); PowerPC::debug_interface.ClearAllBreakpoints();
PowerPC::memchecks.Clear(); PowerPC::debug_interface.ClearAllMemChecks();
NotifyUpdate(); NotifyUpdate();
} }