|
@@ -6,6 +6,8 @@
|
|
|
|
|
|
|
|
#include <array>
|
|
#include <array>
|
|
|
#include "common/common_types.h"
|
|
#include "common/common_types.h"
|
|
|
|
|
+#include "common/logging/log.h"
|
|
|
|
|
+#include "core/memory.h"
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
namespace Kernel {
|
|
|
enum class VMAPermission : u8;
|
|
enum class VMAPermission : u8;
|
|
@@ -142,7 +144,21 @@ public:
|
|
|
/// Prepare core for thread reschedule (if needed to correctly handle state)
|
|
/// Prepare core for thread reschedule (if needed to correctly handle state)
|
|
|
virtual void PrepareReschedule() = 0;
|
|
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
|
|
} // namespace Core
|