Skip to content
Snippets Groups Projects
Unverified Commit f96bb252 authored by bunnei's avatar bunnei Committed by GitHub
Browse files

Merge pull request #1966 from lioncash/backtrace

arm_interface: Minor cleanup
parents 09ffa0cb 039e58a9
No related branches found
No related tags found
No related merge requests found
...@@ -2,19 +2,20 @@ ...@@ -2,19 +2,20 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "arm_interface.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "core/arm/arm_interface.h"
#include "core/memory.h" #include "core/memory.h"
namespace Core { namespace Core {
void ARM_Interface::LogBacktrace() { void ARM_Interface::LogBacktrace() const {
VAddr fp = GetReg(29); VAddr fp = GetReg(29);
VAddr lr = GetReg(30); VAddr lr = GetReg(30);
VAddr sp = GetReg(13); const VAddr sp = GetReg(13);
VAddr pc = GetPC(); const VAddr pc = GetPC();
LOG_ERROR(Core_ARM, "Backtrace, sp={:016X}, pc={:016X}", sp, pc); LOG_ERROR(Core_ARM, "Backtrace, sp={:016X}, pc={:016X}", sp, pc);
for (;;) { while (true) {
LOG_ERROR(Core_ARM, "{:016X}", lr); LOG_ERROR(Core_ARM, "{:016X}", lr);
if (!fp) { if (!fp) {
break; break;
...@@ -23,4 +24,4 @@ void ARM_Interface::LogBacktrace() { ...@@ -23,4 +24,4 @@ void ARM_Interface::LogBacktrace() {
fp = Memory::Read64(fp); fp = Memory::Read64(fp);
} }
} }
}; // namespace Core } // namespace Core
...@@ -148,7 +148,7 @@ public: ...@@ -148,7 +148,7 @@ public:
/// Frame records are two words long: /// Frame records are two words long:
/// fp+0 : pointer to previous frame record /// fp+0 : pointer to previous frame record
/// fp+8 : value of lr for frame /// fp+8 : value of lr for frame
void LogBacktrace(); void LogBacktrace() const;
}; };
} // namespace Core } // namespace Core
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment