summaryrefslogtreecommitdiff
path: root/Source/Core/DebuggerWX/Src/CodeView.cpp
diff options
context:
space:
mode:
authorJohn Peterson <jpeterson57@gmail.com>2009-06-09 05:26:39 +0000
committerJohn Peterson <jpeterson57@gmail.com>2009-06-09 05:26:39 +0000
commit33a0f0838ba38b55be5f87437ce803c4d09c4739 (patch)
treeb8c1fc9457a81583ebf0f8180b48999b5830f140 /Source/Core/DebuggerWX/Src/CodeView.cpp
parentbb412e56413408f02e3edbffd91b55cf54336555 (diff)
Debugging: Added 'insert nop' to menu, added 'show history' code for interpreter mode
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3388 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DebuggerWX/Src/CodeView.cpp')
-rw-r--r--Source/Core/DebuggerWX/Src/CodeView.cpp62
1 files changed, 36 insertions, 26 deletions
diff --git a/Source/Core/DebuggerWX/Src/CodeView.cpp b/Source/Core/DebuggerWX/Src/CodeView.cpp
index 3625ffde53..c958e30f56 100644
--- a/Source/Core/DebuggerWX/Src/CodeView.cpp
+++ b/Source/Core/DebuggerWX/Src/CodeView.cpp
@@ -38,7 +38,7 @@ enum
IDM_COPYADDRESS,
IDM_COPYHEX,
IDM_COPYCODE,
- IDM_INSERTBLR,
+ IDM_INSERTBLR, IDM_INSERTNOP,
IDM_RUNTOHERE,
IDM_JITRESULTS,
IDM_FOLLOWBRANCH,
@@ -190,6 +190,36 @@ u32 CCodeView::AddrToBranch(u32 addr)
return 0;
}
+void CCodeView::InsertBlrNop(int Blr)
+{
+ // Check if this address has been modified
+ int find = -1;
+ for(u32 i = 0; i < BlrList.size(); i++)
+ {
+ if(BlrList.at(i).Address == selection)
+ { find = i; break; }
+ }
+
+ // Save the old value
+ if(find >= 0)
+ {
+ Memory::Write_U32(BlrList.at(find).OldValue, selection);
+ BlrList.erase(BlrList.begin() + find);
+ }
+ else
+ {
+ BlrStruct Temp;
+ Temp.Address = selection;
+ Temp.OldValue = debugger->readMemory(selection);
+ BlrList.push_back(Temp);
+ if (Blr == 0)
+ debugger->insertBLR(selection, 0x4e800020);
+ else
+ debugger->insertBLR(selection, 0x60000000);
+ }
+ redraw();
+}
+
void CCodeView::OnPopupMenu(wxCommandEvent& event)
{
#if wxUSE_CLIPBOARD
@@ -252,31 +282,10 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
// Insert blr or restore old value
case IDM_INSERTBLR:
- {
- // Check if this address has been modified
- int find = -1;
- for(u32 i = 0; i < BlrList.size(); i++)
- {
- if(BlrList.at(i).Address == selection)
- { find = i; break; }
- }
-
- // Save the old value
- if(find >= 0)
- {
- Memory::Write_U32(BlrList.at(find).OldValue, selection);
- BlrList.erase(BlrList.begin() + find);
- }
- else
- {
- BlrStruct Temp;
- Temp.Address = selection;
- Temp.OldValue = debugger->readMemory(selection);
- BlrList.push_back(Temp);
- debugger->insertBLR(selection);
- }
- redraw();
- }
+ InsertBlrNop(0);
+ break;
+ case IDM_INSERTNOP:
+ InsertBlrNop(1);
break;
case IDM_JITRESULTS:
@@ -349,6 +358,7 @@ void CCodeView::OnMouseUpR(wxMouseEvent& event)
menu.Append(IDM_ADDFUNCTION, _T("&Add function"));
menu.Append(IDM_JITRESULTS, wxString::FromAscii("PPC vs X86"));
menu.Append(IDM_INSERTBLR, wxString::FromAscii("Insert &blr"));
+ menu.Append(IDM_INSERTNOP, wxString::FromAscii("Insert &nop"));
menu.Append(IDM_PATCHALERT, wxString::FromAscii("Patch alert"));
PopupMenu(&menu);
event.Skip(true);