2018-12-28 20:55:19 -05:00
|
|
|
// Copyright 2018 yuzu emulator team
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include "common/common_types.h"
|
|
|
|
#include "common/logging/log.h"
|
2018-12-30 20:46:27 -05:00
|
|
|
#include "core/arm/arm_interface.h"
|
2018-12-28 20:55:19 -05:00
|
|
|
#include "core/memory.h"
|
|
|
|
|
|
|
|
namespace Core {
|
2018-12-30 20:44:46 -05:00
|
|
|
void ARM_Interface::LogBacktrace() const {
|
2018-12-28 20:55:19 -05:00
|
|
|
VAddr fp = GetReg(29);
|
|
|
|
VAddr lr = GetReg(30);
|
2018-12-30 20:43:15 -05:00
|
|
|
const VAddr sp = GetReg(13);
|
|
|
|
const VAddr pc = GetPC();
|
|
|
|
|
2018-12-28 20:55:19 -05:00
|
|
|
LOG_ERROR(Core_ARM, "Backtrace, sp={:016X}, pc={:016X}", sp, pc);
|
2018-12-30 20:43:15 -05:00
|
|
|
while (true) {
|
2018-12-28 20:55:19 -05:00
|
|
|
LOG_ERROR(Core_ARM, "{:016X}", lr);
|
|
|
|
if (!fp) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
lr = Memory::Read64(fp + 8) - 4;
|
|
|
|
fp = Memory::Read64(fp);
|
|
|
|
}
|
|
|
|
}
|
2018-12-30 20:41:30 -05:00
|
|
|
} // namespace Core
|