diff --git a/rpcs3/Emu/CPU/CPUThread.cpp b/rpcs3/Emu/CPU/CPUThread.cpp index f948836ef5..4267e56f91 100644 --- a/rpcs3/Emu/CPU/CPUThread.cpp +++ b/rpcs3/Emu/CPU/CPUThread.cpp @@ -28,6 +28,7 @@ CPUThread::CPUThread(CPUThreadType type) , m_is_step(false) , m_is_branch(false) , m_status(Stopped) + , m_last_syscall(0) { } @@ -284,7 +285,8 @@ void _se_translator(unsigned int u, EXCEPTION_POINTERS* pExp) // TODO: allow recovering from a page fault //GetCurrentPPUThread().Stop(); Emu.Pause(); - throw fmt::Format("Access violation: addr = 0x%x", (u32)addr); + throw fmt::Format("Access violation: addr = 0x%x (last_syscall=0x%llx)", + (u32)addr, (u64)GetCurrentCPUThread()->m_last_syscall); } else { diff --git a/rpcs3/Emu/CPU/CPUThread.h b/rpcs3/Emu/CPU/CPUThread.h index 343f992d8f..2ecd40ad4a 100644 --- a/rpcs3/Emu/CPU/CPUThread.h +++ b/rpcs3/Emu/CPU/CPUThread.h @@ -133,6 +133,7 @@ public: bool m_is_interrupt; bool m_has_interrupt; u64 m_interrupt_arg; + u64 m_last_syscall; protected: CPUThread(CPUThreadType type); diff --git a/rpcs3/Emu/Cell/PPUInterpreter.h b/rpcs3/Emu/Cell/PPUInterpreter.h index 2f793db9c9..3f27b769ca 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.h +++ b/rpcs3/Emu/Cell/PPUInterpreter.h @@ -66,6 +66,7 @@ private: void SysCall() { + CPU.m_last_syscall = CPU.GPR[11]; SysCalls::DoSyscall(CPU.GPR[11]); if(Ini.HLELogging.GetValue()) @@ -81,6 +82,8 @@ private: #ifdef HLE_CALL_DEBUG LOG_NOTICE(PPU, "SysCall[%lld] done with code [0x%llx]! #pc: 0x%llx", CPU.GPR[11], CPU.GPR[3], CPU.PC); #endif + + CPU.m_last_syscall = 0; } void NULL_OP() diff --git a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp index 0d393eaec1..efb280d2c0 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp @@ -298,7 +298,7 @@ s32 sys_spu_thread_group_join(u32 id, mem32_t cause, mem32_t status) } if (Emu.IsStopped()) { - LOG_WARNING(Log::SPU, "sys_spu_thread_group_join(id=%d, ...) aborted", id); + LOG_WARNING(Log::SPU, "sys_spu_thread_group_join(id=%d) aborted", id); return CELL_OK; } std::this_thread::sleep_for(std::chrono::milliseconds(1));