Last syscall registering

This commit is contained in:
Nekotekina 2014-08-09 20:01:55 +04:00
parent 3d47c8ab9f
commit 6f8fb71d15
4 changed files with 8 additions and 2 deletions

View File

@ -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
{

View File

@ -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);

View File

@ -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()

View File

@ -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));