diff options
author | David Marcec <dmarcecguzman@gmail.com> | 2018-12-03 10:13:48 +0100 |
---|---|---|
committer | David Marcec <dmarcecguzman@gmail.com> | 2018-12-03 10:13:48 +0100 |
commit | 5102c912569a29259ec26aa254d4598e81205a17 (patch) | |
tree | d7437b2cf2fd53771735a2938174a4aaaed03e4e /src/core/arm/unicorn/arm_unicorn.cpp | |
parent | Print backtrace on svcBreak (diff) | |
download | yuzu-5102c912569a29259ec26aa254d4598e81205a17.tar yuzu-5102c912569a29259ec26aa254d4598e81205a17.tar.gz yuzu-5102c912569a29259ec26aa254d4598e81205a17.tar.bz2 yuzu-5102c912569a29259ec26aa254d4598e81205a17.tar.lz yuzu-5102c912569a29259ec26aa254d4598e81205a17.tar.xz yuzu-5102c912569a29259ec26aa254d4598e81205a17.tar.zst yuzu-5102c912569a29259ec26aa254d4598e81205a17.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/arm/unicorn/arm_unicorn.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/arm/unicorn/arm_unicorn.cpp b/src/core/arm/unicorn/arm_unicorn.cpp index ded4dd359..c9495124e 100644 --- a/src/core/arm/unicorn/arm_unicorn.cpp +++ b/src/core/arm/unicorn/arm_unicorn.cpp @@ -10,6 +10,7 @@ #include "core/core.h" #include "core/core_timing.h" #include "core/hle/kernel/svc.h" +#include "core/memory.h" namespace Core { @@ -266,6 +267,22 @@ void ARM_Unicorn::ClearExclusiveState() {} void ARM_Unicorn::ClearInstructionCache() {} +void ARM_Unicorn::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); + } +} + void ARM_Unicorn::RecordBreak(GDBStub::BreakpointAddress bkpt) { last_bkpt = bkpt; last_bkpt_hit = true; |