diff options
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 4ffb76818..a044db6e7 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -388,6 +388,23 @@ bool Thread::InvokeWakeupCallback(ThreadWakeupReason reason, SharedPtr<Thread> t | |||
| 388 | return wakeup_callback(reason, std::move(thread), std::move(object), index); | 388 | return wakeup_callback(reason, std::move(thread), std::move(object), index); |
| 389 | } | 389 | } |
| 390 | 390 | ||
| 391 | void Thread::LogBacktrace() { | ||
| 392 | auto& system = Core::System::GetInstance(); | ||
| 393 | VAddr fp = system.ArmInterface(processor_id).GetReg(29); | ||
| 394 | VAddr lr = system.ArmInterface(processor_id).GetReg(30); | ||
| 395 | VAddr sp = system.ArmInterface(processor_id).GetReg(13); | ||
| 396 | VAddr pc = system.ArmInterface(processor_id).GetPC(); | ||
| 397 | LOG_ERROR(Debug, "Backtrace, sp={:016X}, pc={:016X}", sp, pc); | ||
| 398 | for (std::size_t i = 0; i < 256; i++) { | ||
| 399 | LOG_ERROR(Debug, "{:016X}", lr - 4); | ||
| 400 | if (!fp) { | ||
| 401 | break; | ||
| 402 | } | ||
| 403 | lr = Memory::Read64(fp + 8); | ||
| 404 | fp = Memory::Read64(fp); | ||
| 405 | } | ||
| 406 | } | ||
| 407 | |||
| 391 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 408 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 392 | 409 | ||
| 393 | /** | 410 | /** |