Skip to content

Commit

Permalink
Debugger/PPU: Add Go-To from function pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Sep 26, 2023
1 parent 7400425 commit fcfe68e
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion rpcs3/rpcs3qt/debugger_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit fcfe68e

Please sign in to comment.