Merge pull request #1966 from lioncash/backtrace

arm_interface: Minor cleanup
This commit is contained in:
bunnei 2018-12-31 11:11:00 -05:00 committed by GitHub
commit f96bb2520b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View file

@ -2,19 +2,20 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "arm_interface.h"
#include "common/common_types.h"
#include "common/logging/log.h"
#include "core/arm/arm_interface.h"
#include "core/memory.h"
namespace Core {
void ARM_Interface::LogBacktrace() {
void ARM_Interface::LogBacktrace() const {
VAddr fp = GetReg(29);
VAddr lr = GetReg(30);
VAddr sp = GetReg(13);
VAddr pc = GetPC();
const VAddr sp = GetReg(13);
const VAddr pc = GetPC();
LOG_ERROR(Core_ARM, "Backtrace, sp={:016X}, pc={:016X}", sp, pc);
for (;;) {
while (true) {
LOG_ERROR(Core_ARM, "{:016X}", lr);
if (!fp) {
break;
@ -23,4 +24,4 @@ void ARM_Interface::LogBacktrace() {
fp = Memory::Read64(fp);
}
}
}; // namespace Core
} // namespace Core

View file

@ -148,7 +148,7 @@ public:
/// Frame records are two words long:
/// fp+0 : pointer to previous frame record
/// fp+8 : value of lr for frame
void LogBacktrace();
void LogBacktrace() const;
};
} // namespace Core