Debugger: Made Insert blr toggle between blr and old value

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1326 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson 2008-11-29 08:38:03 +00:00
parent e168f95257
commit f4cae8c9b7
2 changed files with 35 additions and 2 deletions

View File

@ -18,6 +18,7 @@
#include "Debugger.h"
#include "Debugger/PPCDebugInterface.h"
#include "PowerPC/SymbolDB.h"
#include "HW/Memmap.h" // for Write_U32
#include "Common.h"
#include "StringUtil.h"
@ -238,9 +239,33 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
redraw();
break;
// Insert blr or restore old value
case IDM_INSERTBLR:
debugger->insertBLR(selection);
redraw();
{
// Check if this address has been modified
int find = -1;
for(int 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();
}
break;
case IDM_JITRESULTS:

View File

@ -22,6 +22,7 @@
#include "Common.h"
#include "Debugger/DebugInterface.h"
#include <vector>
#include <wx/wx.h>
DECLARE_EVENT_TYPE(wxEVT_CODEVIEW_CHANGE, -1);
@ -42,6 +43,13 @@ class CCodeView
u32 GetSelection() {return(selection);}
struct BlrStruct // for IDM_INSERTBLR
{
u32 Address;
u32 OldValue;
};
std::vector<BlrStruct> BlrList;
void Center(u32 addr)
{
curAddress = addr;