Extend ppu_thread::call_history_t formatter

This commit is contained in:
Eladash 2021-07-18 21:06:06 +03:00 committed by Megamouse
parent 83a2f06e3a
commit e6e0210e73

View File

@ -123,9 +123,13 @@ void fmt_class_string<typename ppu_thread::call_history_t>::format(std::string&
{ {
const auto& history = get_object(arg); const auto& history = get_object(arg);
PPUDisAsm dis_asm(cpu_disasm_mode::normal, vm::g_sudo_addr);
for (u64 count = 0, idx = history.index - 1; idx != umax && count < ppu_thread::call_history_max_size; count++, idx--) for (u64 count = 0, idx = history.index - 1; idx != umax && count < ppu_thread::call_history_max_size; count++, idx--)
{ {
fmt::append(out, "\n(%u) 0x%08x", count, history.data[idx % ppu_thread::call_history_max_size]); const u32 pc = history.data[idx % ppu_thread::call_history_max_size];
dis_asm.disasm(pc);
fmt::append(out, "\n(%u) 0x%08x: %s", count, pc, dis_asm.last_opcode);
} }
} }