diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index 05379c5b88..932d494c62 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -110,11 +110,7 @@ std::string dump_useful_thread_info() if (auto cpu = get_current_cpu_thread()) { - // Wrap it to disable some internal exceptions when printing (not thrown on main thread) - Emu.BlockingCallFromMainThread([&]() - { - cpu->dump_all(result); - }); + cpu->dump_all(result); } return result; diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index 538d224ddd..6c5ccd4c60 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -133,14 +133,26 @@ void fmt_class_string::format(std::string& 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 < history.data.size(); count++, idx--) { - const u32 pc = history.data[idx % ppu_thread::call_history_max_size]; + const u32 pc = history.data[idx % history.data.size()]; dis_asm.disasm(pc); fmt::append(out, "\n(%u) 0x%08x: %s", count, pc, dis_asm.last_opcode); } } +template <> +void fmt_class_string::format(std::string& out, u64 arg) +{ + const auto& history = get_object(arg); + + for (u64 count = 0, idx = history.index - 1; idx != umax && count < history.data.size(); count++, idx--) + { + const auto& entry = history.data[idx % history.data.size()]; + fmt::append(out, "\n(%u) 0x%08x: %s, 0x%x, r3=0x%x, r4=0x%x, r5=0x%x, r6=0x%x", count, entry.cia, entry.func_name, entry.error, entry.args[0], entry.args[1], entry.args[2], entry.args[3]); + } +} + extern const ppu_decoder g_ppu_itype{}; extern const ppu_decoder g_ppu_iname{}; @@ -1601,6 +1613,15 @@ void ppu_thread::dump_all(std::string& ret) const fmt::append(ret, "%s", call_history); } + + if (syscall_history.data.size() > 1) + { + ret += + "\nHLE/LV2 History:" + "\n================"; + + fmt::append(ret, "%s", syscall_history); + } } extern thread_local std::string(*g_tls_log_prefix)(); diff --git a/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp index b09dc25e02..35661a22cd 100644 --- a/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp @@ -63,9 +63,14 @@ void ppu_thread_exit(ppu_thread& ppu, ppu_opcode_t, be_t*, struct ppu_intrp if (ppu.call_history.index) { - std::string str = fmt::format("%s", ppu.call_history); + ppu_log.notice("Calling history: %s", ppu.call_history); ppu.call_history.index = 0; - ppu_log.notice("Calling history: %s", str); + } + + if (ppu.syscall_history.index) + { + ppu_log.notice("HLE/LV2 history: %s", ppu.syscall_history); + ppu.syscall_history.index = 0; } }