diff options
| author | 2018-12-29 12:55:19 +1100 | |
|---|---|---|
| committer | 2018-12-29 12:55:19 +1100 | |
| commit | 22d4e106642ac9d6a0dabc700c4dcd47be08ff41 (patch) | |
| tree | 61eaf5a2b7c296828c58a92791f7094b34285428 /src/core/arm/arm_interface.h | |
| parent | Moved backtrace to ArmInterface (diff) | |
| download | yuzu-22d4e106642ac9d6a0dabc700c4dcd47be08ff41.tar.gz yuzu-22d4e106642ac9d6a0dabc700c4dcd47be08ff41.tar.xz yuzu-22d4e106642ac9d6a0dabc700c4dcd47be08ff41.zip | |
Moved log backtrace to arm_interface.cpp. Added printing of error code to fatal
Diffstat (limited to 'src/core/arm/arm_interface.h')
| -rw-r--r-- | src/core/arm/arm_interface.h | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index b0472d55d..91d2b0f81 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h | |||
| @@ -6,8 +6,6 @@ | |||
| 6 | 6 | ||
| 7 | #include <array> | 7 | #include <array> |
| 8 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 9 | #include "common/logging/log.h" | ||
| 10 | #include "core/memory.h" | ||
| 11 | 9 | ||
| 12 | namespace Kernel { | 10 | namespace Kernel { |
| 13 | enum class VMAPermission : u8; | 11 | enum class VMAPermission : u8; |
| @@ -144,21 +142,13 @@ public: | |||
| 144 | /// Prepare core for thread reschedule (if needed to correctly handle state) | 142 | /// Prepare core for thread reschedule (if needed to correctly handle state) |
| 145 | virtual void PrepareReschedule() = 0; | 143 | virtual void PrepareReschedule() = 0; |
| 146 | 144 | ||
| 147 | void LogBacktrace() { | 145 | /// fp (= r29) points to the last frame record. |
| 148 | VAddr fp = GetReg(29); | 146 | /// Note that this is the frame record for the *previous* frame, not the current one. |
| 149 | VAddr lr = GetReg(30); | 147 | /// Note we need to subtract 4 from our last read to get the proper address |
| 150 | VAddr sp = GetReg(13); | 148 | /// Frame records are two words long: |
| 151 | VAddr pc = GetPC(); | 149 | /// fp+0 : pointer to previous frame record |
| 152 | LOG_ERROR(Core_ARM, "Backtrace, sp={:016X}, pc={:016X}", sp, pc); | 150 | /// fp+8 : value of lr for frame |
| 153 | for (;;) { | 151 | void LogBacktrace(); |
| 154 | LOG_ERROR(Core_ARM, "{:016X}", lr); | ||
| 155 | if (!fp) { | ||
| 156 | break; | ||
| 157 | } | ||
| 158 | lr = Memory::Read64(fp + 8) - 4; | ||
| 159 | fp = Memory::Read64(fp); | ||
| 160 | } | ||
| 161 | } | ||
| 162 | }; | 152 | }; |
| 163 | 153 | ||
| 164 | } // namespace Core | 154 | } // namespace Core |