diff options
author | David Marcec <dmarcecguzman@gmail.com> | 2018-12-19 04:10:51 +0100 |
---|---|---|
committer | David Marcec <dmarcecguzman@gmail.com> | 2018-12-19 04:10:51 +0100 |
commit | 08d5663cb8989f6e57cc28e02c572367685d69fd (patch) | |
tree | ea69bc539f01e2a2b7b99168b4fcb2834027f5ec /src/core/arm/arm_interface.h | |
parent | Moved backtrace to ArmInterface (diff) | |
download | yuzu-08d5663cb8989f6e57cc28e02c572367685d69fd.tar yuzu-08d5663cb8989f6e57cc28e02c572367685d69fd.tar.gz yuzu-08d5663cb8989f6e57cc28e02c572367685d69fd.tar.bz2 yuzu-08d5663cb8989f6e57cc28e02c572367685d69fd.tar.lz yuzu-08d5663cb8989f6e57cc28e02c572367685d69fd.tar.xz yuzu-08d5663cb8989f6e57cc28e02c572367685d69fd.tar.zst yuzu-08d5663cb8989f6e57cc28e02c572367685d69fd.zip |
Diffstat (limited to 'src/core/arm/arm_interface.h')
-rw-r--r-- | src/core/arm/arm_interface.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 26fe68a2e..b0472d55d 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h @@ -6,6 +6,8 @@ #include <array> #include "common/common_types.h" +#include "common/logging/log.h" +#include "core/memory.h" namespace Kernel { enum class VMAPermission : u8; @@ -142,7 +144,21 @@ public: /// Prepare core for thread reschedule (if needed to correctly handle state) virtual void PrepareReschedule() = 0; - virtual void LogBacktrace() = 0; + void LogBacktrace() { + VAddr fp = GetReg(29); + VAddr lr = GetReg(30); + VAddr sp = GetReg(13); + VAddr pc = GetPC(); + LOG_ERROR(Core_ARM, "Backtrace, sp={:016X}, pc={:016X}", sp, pc); + for (;;) { + LOG_ERROR(Core_ARM, "{:016X}", lr); + if (!fp) { + break; + } + lr = Memory::Read64(fp + 8) - 4; + fp = Memory::Read64(fp); + } + } }; } // namespace Core |