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 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;}

View File

@ -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)
{
@ -118,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()

View File

@ -14,31 +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 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;
};

View File

@ -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.");

View File

@ -14,24 +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 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;
};

View File

@ -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();
}