36 changes: 18 additions & 18 deletions Source/Core/Core/HW/DSPLLE/DSPDebugInterface.cpp
Expand Up @@ -8,14 +8,14 @@
#include "Core/HW/DSPLLE/DSPDebugInterface.h"
#include "Core/HW/DSPLLE/DSPSymbols.h"

void DSPDebugInterface::disasm(unsigned int address, char *dest, int max_size)
void DSPDebugInterface::Disassemble(unsigned int address, char *dest, int max_size)
{
// we'll treat addresses as line numbers.
strncpy(dest, DSPSymbols::GetLineText(address), max_size);
dest[max_size-1] = 0;
}

void DSPDebugInterface::getRawMemoryString(int memory, unsigned int address, char *dest, int max_size)
void DSPDebugInterface::GetRawMemoryString(int memory, unsigned int address, char *dest, int max_size)
{
if (DSPCore_GetState() == DSPCORE_STOP)
{
Expand Down Expand Up @@ -55,22 +55,22 @@ void DSPDebugInterface::getRawMemoryString(int memory, unsigned int address, cha
}
}

unsigned int DSPDebugInterface::readMemory(unsigned int address)
unsigned int DSPDebugInterface::ReadMemory(unsigned int address)
{
return 0; //Memory::ReadUnchecked_U32(address);
}

unsigned int DSPDebugInterface::readInstruction(unsigned int address)
unsigned int DSPDebugInterface::ReadInstruction(unsigned int address)
{
return 0; //Memory::Read_Instruction(address);
}

bool DSPDebugInterface::isAlive()
bool DSPDebugInterface::IsAlive()
{
return true; //Core::GetState() != Core::CORE_UNINITIALIZED;
}

bool DSPDebugInterface::isBreakpoint(unsigned int address)
bool DSPDebugInterface::IsBreakpoint(unsigned int address)
{
int real_addr = DSPSymbols::Line2Addr(address);
if (real_addr >= 0)
Expand All @@ -79,7 +79,7 @@ bool DSPDebugInterface::isBreakpoint(unsigned int address)
return false;
}

void DSPDebugInterface::setBreakpoint(unsigned int address)
void DSPDebugInterface::SetBreakpoint(unsigned int address)
{
int real_addr = DSPSymbols::Line2Addr(address);

Expand All @@ -92,7 +92,7 @@ void DSPDebugInterface::setBreakpoint(unsigned int address)
}
}

void DSPDebugInterface::clearBreakpoint(unsigned int address)
void DSPDebugInterface::ClearBreakpoint(unsigned int address)
{
int real_addr = DSPSymbols::Line2Addr(address);

Expand All @@ -105,12 +105,12 @@ void DSPDebugInterface::clearBreakpoint(unsigned int address)
}
}

void DSPDebugInterface::clearAllBreakpoints()
void DSPDebugInterface::ClearAllBreakpoints()
{
dsp_breakpoints.Clear();
}

void DSPDebugInterface::toggleBreakpoint(unsigned int address)
void DSPDebugInterface::ToggleBreakpoint(unsigned int address)
{
int real_addr = DSPSymbols::Line2Addr(address);
if (real_addr >= 0)
Expand All @@ -122,25 +122,25 @@ void DSPDebugInterface::toggleBreakpoint(unsigned int address)
}
}

bool DSPDebugInterface::isMemCheck(unsigned int address)
bool DSPDebugInterface::IsMemCheck(unsigned int address)
{
return false;
}

void DSPDebugInterface::toggleMemCheck(unsigned int address)
void DSPDebugInterface::ToggleMemCheck(unsigned int address)
{
PanicAlert("MemCheck functionality not supported in DSP module.");
}

void DSPDebugInterface::insertBLR(unsigned int address, unsigned int value)
void DSPDebugInterface::InsertBLR(unsigned int address, unsigned int value)
{
PanicAlert("insertBLR functionality not supported in DSP module.");
}

// =======================================================
// Separate the blocks with colors.
// -------------
int DSPDebugInterface::getColor(unsigned int address)
int DSPDebugInterface::GetColor(unsigned int address)
{
static const int colors[6] =
{
Expand Down Expand Up @@ -173,24 +173,24 @@ int DSPDebugInterface::getColor(unsigned int address)
// =============


std::string DSPDebugInterface::getDescription(unsigned int address)
std::string DSPDebugInterface::GetDescription(unsigned int address)
{
return ""; // g_symbolDB.GetDescription(address);
}

unsigned int DSPDebugInterface::getPC()
unsigned int DSPDebugInterface::GetPC()
{
return DSPSymbols::Addr2Line(g_dsp.pc);
}

void DSPDebugInterface::setPC(unsigned int address)
void DSPDebugInterface::SetPC(unsigned int address)
{
int new_pc = DSPSymbols::Line2Addr(address);
if (new_pc > 0)
g_dsp.pc = new_pc;
}

void DSPDebugInterface::runToBreakpoint()
void DSPDebugInterface::RunToBreakpoint()
{

}
40 changes: 20 additions & 20 deletions Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h
Expand Up @@ -14,24 +14,24 @@ class DSPDebugInterface : public DebugInterface
{
public:
DSPDebugInterface(){}
virtual void disasm(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);
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);
};
2 changes: 1 addition & 1 deletion Source/Core/Core/PowerPC/PPCSymbolDB.cpp
Expand Up @@ -332,7 +332,7 @@ bool PPCSymbolDB::SaveMap(const char *filename, bool WithCodes) const
{
int Address = LastAddress + i;
char disasm[256];
debugger->disasm(Address, disasm, 256);
debugger->Disassemble(Address, disasm, 256);
fprintf(f.GetHandle(),"%08x %i %20s %s\n", Address, 0, TempSym.c_str(), disasm);
}
// Write a blank line after each block
Expand Down
42 changes: 21 additions & 21 deletions Source/Core/DolphinWX/Debugger/CodeView.cpp
Expand Up @@ -71,8 +71,8 @@ CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb,
debugger(debuginterface),
symbol_db(symboldb),
plain(false),
curAddress(debuginterface->getPC()),
align(debuginterface->getInstructionSize(0)),
curAddress(debuginterface->GetPC()),
align(debuginterface->GetInstructionSize(0)),
rowHeight(13),
selection(0),
oldSelection(0),
Expand Down Expand Up @@ -116,7 +116,7 @@ void CCodeView::OnMouseDown(wxMouseEvent& event)

void CCodeView::ToggleBreakpoint(u32 address)
{
debugger->toggleBreakpoint(address);
debugger->ToggleBreakpoint(address);
Refresh();
Host_UpdateBreakPointView();
}
Expand Down Expand Up @@ -169,7 +169,7 @@ void CCodeView::OnMouseUpL(wxMouseEvent& event)
u32 CCodeView::AddrToBranch(u32 addr)
{
char disasm[256];
debugger->disasm(addr, disasm, 256);
debugger->Disassemble(addr, disasm, 256);
const char *mojs = strstr(disasm, "->0x");
if (mojs)
{
Expand All @@ -196,19 +196,19 @@ void CCodeView::InsertBlrNop(int Blr)
// Save the old value
if (find >= 0)
{
debugger->writeExtraMemory(0, BlrList.at(find).OldValue, selection);
debugger->WriteExtraMemory(0, BlrList.at(find).OldValue, selection);
BlrList.erase(BlrList.begin() + find);
}
else
{
BlrStruct Temp;
Temp.Address = selection;
Temp.OldValue = debugger->readMemory(selection);
Temp.OldValue = debugger->ReadMemory(selection);
BlrList.push_back(Temp);
if (Blr == 0)
debugger->insertBLR(selection, 0x4e800020);
debugger->InsertBLR(selection, 0x4e800020);
else
debugger->insertBLR(selection, 0x60000000);
debugger->InsertBLR(selection, 0x60000000);
}
Refresh();
}
Expand All @@ -233,15 +233,15 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
case IDM_COPYCODE:
{
char disasm[256];
debugger->disasm(selection, disasm, 256);
debugger->Disassemble(selection, disasm, 256);
wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(disasm)));
}
break;

case IDM_COPYHEX:
{
char temp[24];
sprintf(temp, "%08x", debugger->readInstruction(selection));
sprintf(temp, "%08x", debugger->ReadInstruction(selection));
wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp)));
}
break;
Expand All @@ -260,7 +260,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
for (u32 addr = start; addr != end; addr += 4)
{
char disasm[256];
debugger->disasm(addr, disasm, 256);
debugger->Disassemble(addr, disasm, 256);
text = text + StringFromFormat("%08x: ", addr) + disasm + "\r\n";
}
wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(text)));
Expand All @@ -270,8 +270,8 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
#endif

case IDM_RUNTOHERE:
debugger->setBreakpoint(selection);
debugger->runToBreakpoint();
debugger->SetBreakpoint(selection);
debugger->RunToBreakpoint();
Refresh();
break;

Expand All @@ -286,7 +286,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
break;

case IDM_JITRESULTS:
debugger->showJitResults(selection);
debugger->ShowJitResults(selection);
break;

case IDM_FOLLOWBRANCH:
Expand Down Expand Up @@ -430,7 +430,7 @@ void CCodeView::OnPaint(wxPaintEvent& event)
int rowY2 = rc.height / 2 + rowHeight * i + rowHeight / 2;

wxString temp = wxString::Format(_T("%08x"), address);
u32 col = debugger->getColor(address);
u32 col = debugger->GetColor(address);
wxBrush rowBrush(wxColor(col >> 16, col >> 8, col));
dc.SetBrush(nullBrush);
dc.SetPen(nullPen);
Expand All @@ -441,7 +441,7 @@ void CCodeView::OnPaint(wxPaintEvent& event)
else
dc.SetPen(i == 0 ? currentPen : nullPen);

if (address == debugger->getPC())
if (address == debugger->GetPC())
dc.SetBrush(pcBrush);
else
dc.SetBrush(rowBrush);
Expand All @@ -456,10 +456,10 @@ void CCodeView::OnPaint(wxPaintEvent& event)
}

// If running
if (debugger->isAlive())
if (debugger->IsAlive())
{
char dis[256];
debugger->disasm(address, dis, 256);
debugger->Disassemble(address, dis, 256);
char* dis2 = strchr(dis, '\t');
char desc[256] = "";

Expand Down Expand Up @@ -494,7 +494,7 @@ void CCodeView::OnPaint(wxPaintEvent& event)
branches[numBranches].src = rowY1 + rowHeight / 2;
branches[numBranches].srcAddr = address / align;
branches[numBranches++].dst = (int)(rowY1 + ((s64)(u32)offs - (s64)(u32)address) * rowHeight / align + rowHeight / 2);
sprintf(desc, "-->%s", debugger->getDescription(offs).c_str());
sprintf(desc, "-->%s", debugger->GetDescription(offs).c_str());
dc.SetTextForeground(_T("#600060")); // the -> arrow illustrations are purple
}
else
Expand All @@ -516,7 +516,7 @@ void CCodeView::OnPaint(wxPaintEvent& event)

if (desc[0] == 0)
{
strcpy(desc, debugger->getDescription(address).c_str());
strcpy(desc, debugger->GetDescription(address).c_str());
}

if (!plain)
Expand All @@ -532,7 +532,7 @@ void CCodeView::OnPaint(wxPaintEvent& event)
}

// Show red breakpoint dot
if (debugger->isBreakpoint(address))
if (debugger->IsBreakpoint(address))
{
dc.SetBrush(bpBrush);
dc.DrawRectangle(2, rowY1 + 1, 11, 11);
Expand Down
38 changes: 19 additions & 19 deletions Source/Core/DolphinWX/Debugger/MemoryView.cpp
Expand Up @@ -56,9 +56,9 @@ END_EVENT_TABLE()

CMemoryView::CMemoryView(DebugInterface* debuginterface, wxWindow* parent)
: wxControl(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize)
, curAddress(debuginterface->getPC())
, curAddress(debuginterface->GetPC())
, debugger(debuginterface)
, align(debuginterface->getInstructionSize(0))
, align(debuginterface->GetInstructionSize(0))
, rowHeight(13)
, selection(0)
, oldSelection(0)
Expand Down Expand Up @@ -93,7 +93,7 @@ void CMemoryView::OnMouseDownL(wxMouseEvent& event)
}
else
{
debugger->toggleMemCheck(YToAddress(y));
debugger->ToggleMemCheck(YToAddress(y));

Refresh();
Host_UpdateBreakPointView();
Expand Down Expand Up @@ -153,7 +153,7 @@ void CMemoryView::OnPopupMenu(wxCommandEvent& event)
case IDM_COPYHEX:
{
char temp[24];
sprintf(temp, "%08x", debugger->readExtraMemory(memory, selection));
sprintf(temp, "%08x", debugger->ReadExtraMemory(memory, selection));
wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp)));
}
break;
Expand Down Expand Up @@ -260,7 +260,7 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
int rowY2 = rc.height / 2 + rowHeight * row + rowHeight / 2;

wxString temp = wxString::Format(_T("%08x"), address);
u32 col = debugger->getColor(address);
u32 col = debugger->GetColor(address);
wxBrush rowBrush(wxColor(col >> 16, col >> 8, col));
dc.SetBrush(nullBrush);
dc.SetPen(nullPen);
Expand All @@ -271,7 +271,7 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
else
dc.SetPen(row == 0 ? currentPen : nullPen);

if (address == debugger->getPC())
if (address == debugger->GetPC())
dc.SetBrush(pcBrush);
else
dc.SetBrush(rowBrush);
Expand All @@ -284,16 +284,16 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
if (viewAsType != VIEWAS_HEX)
{
char mem[256];
debugger->getRawMemoryString(memory, address, mem, 256);
debugger->GetRawMemoryString(memory, address, mem, 256);
dc.SetTextForeground(_T("#000080"));
dc.DrawText(StrToWxStr(mem), 17+fontSize*(8), rowY1);
dc.SetTextForeground(_T("#000000"));
}

if (debugger->isAlive())
if (debugger->IsAlive())
{
char dis[256] = {0};
u32 mem_data = debugger->readExtraMemory(memory, address);
u32 mem_data = debugger->ReadExtraMemory(memory, address);

if (viewAsType == VIEWAS_FP)
{
Expand All @@ -316,14 +316,14 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
dis[0] = 0;
dis[1] = 0;
u32 mema[8] = {
debugger->readExtraMemory(memory, address),
debugger->readExtraMemory(memory, address+4),
debugger->readExtraMemory(memory, address+8),
debugger->readExtraMemory(memory, address+12),
debugger->readExtraMemory(memory, address+16),
debugger->readExtraMemory(memory, address+20),
debugger->readExtraMemory(memory, address+24),
debugger->readExtraMemory(memory, address+28)
debugger->ReadExtraMemory(memory, address),
debugger->ReadExtraMemory(memory, address+4),
debugger->ReadExtraMemory(memory, address+8),
debugger->ReadExtraMemory(memory, address+12),
debugger->ReadExtraMemory(memory, address+16),
debugger->ReadExtraMemory(memory, address+20),
debugger->ReadExtraMemory(memory, address+24),
debugger->ReadExtraMemory(memory, address+28)
};

for (auto& word : mema)
Expand Down Expand Up @@ -369,15 +369,15 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
dc.DrawText(StrToWxStr(dis), textPlacement, rowY1);

if (desc[0] == 0)
strcpy(desc, debugger->getDescription(address).c_str());
strcpy(desc, debugger->GetDescription(address).c_str());

dc.SetTextForeground(_T("#0000FF"));

if (strlen(desc))
dc.DrawText(StrToWxStr(desc), 17+fontSize*((8+8+8+30)*2), rowY1);

// Show blue memory check dot
if (debugger->isMemCheck(address))
if (debugger->IsMemCheck(address))
{
dc.SetBrush(mcBrush);
dc.DrawRectangle(8, rowY1 + 1, 11, 11);
Expand Down