Debugger: make opcode search a bit better

Search a wider range (not all games fit in the originally searched range).
Print a notice if the opcode isn't found, instead of silently failing.
This commit is contained in:
Fiora 2014-09-18 03:46:39 -07:00
parent 74eee70fad
commit 8ce4676605
1 changed files with 6 additions and 2 deletions

View File

@ -557,15 +557,19 @@ void CCodeWindow::OnJitMenu(wxCommandEvent& event)
case IDM_SEARCHINSTRUCTION:
{
wxString str = wxGetTextFromUser("", _("Op?"), wxEmptyString, this);
for (u32 addr = 0x80000000; addr < 0x80100000; addr += 4)
auto const wx_name = WxStrToStr(str);
bool found = false;
for (u32 addr = 0x80000000; addr < 0x80180000; addr += 4)
{
const char *name = PPCTables::GetInstructionName(Memory::ReadUnchecked_U32(addr));
auto const wx_name = WxStrToStr(str);
if (name && (wx_name == name))
{
NOTICE_LOG(POWERPC, "Found %s at %08x", wx_name.c_str(), addr);
found = true;
}
}
if (!found)
NOTICE_LOG(POWERPC, "Opcode %s not found", wx_name.c_str());
break;
}
}