Debugger/PPU: Add Go-To from function pointer

This commit is contained in:
Eladash 2023-09-26 07:55:29 +03:00 committed by Elad Ashkenazi
parent 6dc9e9659d
commit 6908d20128
1 changed files with 23 additions and 1 deletions

View File

@ -1242,10 +1242,32 @@ void debugger_frame::ShowGotoAddressDialog()
void debugger_frame::PerformGoToRequest(const QString& text_argument)
{
const u64 address = EvaluateExpression(text_argument);
const bool asterisk_prefixed = text_argument.startsWith(QChar('*'));
const u64 address = EvaluateExpression(asterisk_prefixed ? text_argument.sliced(1, text_argument.size() - 1) : text_argument);
if (address != umax)
{
// Try to read from OPD entry if prefixed by asterisk
if (asterisk_prefixed)
{
if (auto cpu = get_cpu())
{
if (auto ppu = cpu->try_get<ppu_thread>())
{
const vm::ptr<u32> func_ptr = vm::cast(static_cast<u32>(address));
be_t<u32> code_addr{};
if (func_ptr.try_read(code_addr))
{
m_debugger_list->ShowAddress(code_addr, true);
}
}
}
return;
}
m_debugger_list->ShowAddress(static_cast<u32>(address), true);
}
}