summaryrefslogtreecommitdiff
path: root/src/core/arm/arm_interface.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/arm/arm_interface.h')
-rw-r--r--src/core/arm/arm_interface.h18
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 @@
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"
9 11
10namespace Kernel { 12namespace Kernel {
11enum class VMAPermission : u8; 13enum class VMAPermission : u8;
@@ -142,7 +144,21 @@ public:
142 /// Prepare core for thread reschedule (if needed to correctly handle state) 144 /// Prepare core for thread reschedule (if needed to correctly handle state)
143 virtual void PrepareReschedule() = 0; 145 virtual void PrepareReschedule() = 0;
144 146
145 virtual void LogBacktrace() = 0; 147 void LogBacktrace() {
148 VAddr fp = GetReg(29);
149 VAddr lr = GetReg(30);
150 VAddr sp = GetReg(13);
151 VAddr pc = GetPC();
152 LOG_ERROR(Core_ARM, "Backtrace, sp={:016X}, pc={:016X}", sp, pc);
153 for (;;) {
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 }
146}; 162};
147 163
148} // namespace Core 164} // namespace Core