forked from eden-emu/eden
Print backtrace on svcBreak
When we get an svcBreak we get a backtrace now
This commit is contained in:
parent
ec90b81b27
commit
a305208a35
3 changed files with 24 additions and 0 deletions
|
@ -388,6 +388,23 @@ bool Thread::InvokeWakeupCallback(ThreadWakeupReason reason, SharedPtr<Thread> t
|
|||
return wakeup_callback(reason, std::move(thread), std::move(object), index);
|
||||
}
|
||||
|
||||
void Thread::LogBacktrace() {
|
||||
auto& system = Core::System::GetInstance();
|
||||
VAddr fp = system.ArmInterface(processor_id).GetReg(29);
|
||||
VAddr lr = system.ArmInterface(processor_id).GetReg(30);
|
||||
VAddr sp = system.ArmInterface(processor_id).GetReg(13);
|
||||
VAddr pc = system.ArmInterface(processor_id).GetPC();
|
||||
LOG_ERROR(Debug, "Backtrace, sp={:016X}, pc={:016X}", sp, pc);
|
||||
for (std::size_t i = 0; i < 256; i++) {
|
||||
LOG_ERROR(Debug, "{:016X}", lr - 4);
|
||||
if (!fp) {
|
||||
break;
|
||||
}
|
||||
lr = Memory::Read64(fp + 8);
|
||||
fp = Memory::Read64(fp);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue