diff options
| author | degasus <wickmarkus@web.de> | 2013-04-08 15:57:51 +0200 |
|---|---|---|
| committer | degasus <wickmarkus@web.de> | 2013-04-08 15:57:51 +0200 |
| commit | 702198f39b4eb71a068c20c9969bd86856fa85ae (patch) | |
| tree | bdee823a26505a752dc9c512cfb9bcfee0cbe90f /Source/Core/DolphinWX/Src/Debugger/CodeView.cpp | |
| parent | ca8554e7d1d7c77b3c2a9ed8a7fb12de7096c67b (diff) | |
| parent | 4c40e70b8af839f84d7d9b8306116cabf3965cdb (diff) | |
Merge branch 'master' into primitive_restart
Conflicts:
Source/Core/VideoCommon/Src/VideoConfig.h
Source/Plugins/Plugin_VideoDX9/Src/main.cpp
Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
Diffstat (limited to 'Source/Core/DolphinWX/Src/Debugger/CodeView.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Src/Debugger/CodeView.cpp | 92 |
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 |
