summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Src/Debugger/CodeView.cpp
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2013-04-13 00:58:37 -0500
committerRyan Houdek <Sonicadvance1@gmail.com>2013-04-13 00:58:37 -0500
commit605bbf5ca833399c1a6aad2a3b0e21cb4c910d11 (patch)
tree53acc60e471e39f234af37ac56c4ce39029eb60b /Source/Core/DolphinWX/Src/Debugger/CodeView.cpp
parent2444fdbbdd4310f0e012b661d258b20a4eaf4800 (diff)
parent48927c17d252223ffdaa5cfb34aa850eb6ee6ee1 (diff)
Merge remote-tracking branch 'origin/master' into Android-trash
Diffstat (limited to 'Source/Core/DolphinWX/Src/Debugger/CodeView.cpp')
-rw-r--r--Source/Core/DolphinWX/Src/Debugger/CodeView.cpp92
1 files changed, 50 insertions, 42 deletions
diff --git a/Source/Core/DolphinWX/Src/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Src/Debugger/CodeView.cpp
index 31ad19d6da..1c7bf22d82 100644
--- a/Source/Core/DolphinWX/Src/Debugger/CodeView.cpp
+++ b/Source/Core/DolphinWX/Src/Debugger/CodeView.cpp
@@ -62,20 +62,20 @@ END_EVENT_TABLE()
CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb,
wxWindow* parent, wxWindowID Id)
: wxControl(parent, Id),
- debugger(debuginterface),
+ debugger(debuginterface),
symbol_db(symboldb),
plain(false),
curAddress(debuginterface->getPC()),
align(debuginterface->getInstructionSize(0)),
- rowHeight(13),
- selection(0),
- oldSelection(0),
- selectionChanged(false),
- selecting(false),
- hasFocus(false),
- showHex(false),
- lx(-1),
- ly(-1)
+ rowHeight(13),
+ selection(0),
+ oldSelection(0),
+ selectionChanged(false),
+ selecting(false),
+ hasFocus(false),
+ showHex(false),
+ lx(-1),
+ ly(-1)
{
}
@@ -104,7 +104,9 @@ void CCodeView::OnMouseDown(wxMouseEvent& event)
Refresh();
}
else
+ {
ToggleBreakpoint(YToAddress(y));
+ }
event.Skip(true);
}
@@ -133,7 +135,9 @@ void CCodeView::OnMouseMove(wxMouseEvent& event)
Refresh();
}
else
+ {
OnMouseDown(event);
+ }
}
event.Skip(true);
@@ -176,14 +180,17 @@ u32 CCodeView::AddrToBranch(u32 addr)
void CCodeView::InsertBlrNop(int Blr)
{
// Check if this address has been modified
- int find = -1;
+ int find = -1;
for(u32 i = 0; i < BlrList.size(); i++)
{
if(BlrList.at(i).Address == selection)
- { find = i; break; }
+ {
+ find = i;
+ break;
+ }
}
- // Save the old value
+ // Save the old value
if (find >= 0)
{
debugger->writeExtraMemory(0, BlrList.at(find).OldValue, selection);
@@ -196,11 +203,11 @@ void CCodeView::InsertBlrNop(int Blr)
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();
+ Refresh();
}
void CCodeView::OnPopupMenu(wxCommandEvent& event)
@@ -211,14 +218,14 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
switch (event.GetId())
{
- case IDM_GOTOINMEMVIEW:
- // CMemoryDlg::Goto(selection);
- break;
+ case IDM_GOTOINMEMVIEW:
+ // CMemoryDlg::Goto(selection);
+ break;
#if wxUSE_CLIPBOARD
- case IDM_COPYADDRESS:
- wxTheClipboard->SetData(new wxTextDataObject(wxString::Format(_T("%08x"), selection)));
- break;
+ case IDM_COPYADDRESS:
+ wxTheClipboard->SetData(new wxTextDataObject(wxString::Format(_T("%08x"), selection)));
+ break;
case IDM_COPYCODE:
{
@@ -228,13 +235,13 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
}
break;
- case IDM_COPYHEX:
- {
- char temp[24];
- sprintf(temp, "%08x", debugger->readInstruction(selection));
- wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp)));
- }
- break;
+ case IDM_COPYHEX:
+ {
+ char temp[24];
+ sprintf(temp, "%08x", debugger->readInstruction(selection));
+ wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp)));
+ }
+ break;
case IDM_COPYFUNCTION:
@@ -259,11 +266,11 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
break;
#endif
- case IDM_RUNTOHERE:
- debugger->setBreakpoint(selection);
- debugger->runToBreakpoint();
- Refresh();
- break;
+ case IDM_RUNTOHERE:
+ debugger->setBreakpoint(selection);
+ debugger->runToBreakpoint();
+ Refresh();
+ break;
// Insert blr or restore old value
case IDM_INSERTBLR:
@@ -275,9 +282,9 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
Refresh();
break;
- case IDM_JITRESULTS:
+ case IDM_JITRESULTS:
debugger->showJitResults(selection);
- break;
+ break;
case IDM_FOLLOWBRANCH:
{
@@ -366,7 +373,7 @@ void CCodeView::OnPaint(wxPaintEvent& event)
dc.GetTextExtent(_T("0WJyq"),&w,&h);
if (h > rowHeight)
- rowHeight = h;
+ rowHeight = h;
dc.GetTextExtent(_T("W"),&w,&h);
int charWidth = w;
@@ -507,7 +514,8 @@ void CCodeView::OnPaint(wxPaintEvent& event)
strcpy(desc, debugger->getDescription(address).c_str());
}
- if (!plain) {
+ if (!plain)
+ {
dc.SetTextForeground(_T("#0000FF")); // blue
//char temp[256];
@@ -535,11 +543,11 @@ void CCodeView::OnPaint(wxPaintEvent& event)
for (int i = 0; i < numBranches; i++)
{
- int x = 17 + 49 * charWidth + (branches[i].srcAddr % 9) * 8;
- _MoveTo(x-2, branches[i].src);
+ int x = 17 + 49 * charWidth + (branches[i].srcAddr % 9) * 8;
+ _MoveTo(x-2, branches[i].src);
if (branches[i].dst < rc.height + 400 && branches[i].dst > -400)
- {
+ {
_LineTo(dc, x+2, branches[i].src);
_LineTo(dc, x+2, branches[i].dst);
_LineTo(dc, x-4, branches[i].dst);
@@ -547,7 +555,7 @@ void CCodeView::OnPaint(wxPaintEvent& event)
_MoveTo(x, branches[i].dst - 4);
_LineTo(dc, x-4, branches[i].dst);
_LineTo(dc, x+1, branches[i].dst+5);
- }
+ }
//else
//{
// This can be re-enabled when there is a scrollbar or