From 15b2878b2049371178999c16ad16e216d902362a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 30 Dec 2018 20:41:30 -0500 Subject: [PATCH 1/4] arm_interface: Remove unnecessary semicolon Namespaces don't require the use of a semicolon. Silences a -Wextra-semi warning. --- src/core/arm/arm_interface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/arm/arm_interface.cpp b/src/core/arm/arm_interface.cpp index bcc812da48..f01cc4b6ed 100644 --- a/src/core/arm/arm_interface.cpp +++ b/src/core/arm/arm_interface.cpp @@ -23,4 +23,4 @@ void ARM_Interface::LogBacktrace() { fp = Memory::Read64(fp); } } -}; // namespace Core +} // namespace Core From fc4f95104dc0d42006438ba6d52b29a84bd7f7cf Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 30 Dec 2018 20:43:15 -0500 Subject: [PATCH 2/4] arm_interface: Mark variables as const where applicable in LogBacktrace() Two of these variables have fixed values, so we can make that immediately obvious from the get-go. --- src/core/arm/arm_interface.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/arm/arm_interface.cpp b/src/core/arm/arm_interface.cpp index f01cc4b6ed..8ab605d215 100644 --- a/src/core/arm/arm_interface.cpp +++ b/src/core/arm/arm_interface.cpp @@ -11,10 +11,11 @@ namespace Core { void ARM_Interface::LogBacktrace() { 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; From 9dcdcdbc012ee3d580b982570bc216129768e5f4 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 30 Dec 2018 20:44:46 -0500 Subject: [PATCH 3/4] arm_interface: Make LogBacktrace() a const member function This function doesn't modify instance state, so it can be made const. --- src/core/arm/arm_interface.cpp | 2 +- src/core/arm/arm_interface.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/arm/arm_interface.cpp b/src/core/arm/arm_interface.cpp index 8ab605d215..b0c9a58363 100644 --- a/src/core/arm/arm_interface.cpp +++ b/src/core/arm/arm_interface.cpp @@ -8,7 +8,7 @@ #include "core/memory.h" namespace Core { -void ARM_Interface::LogBacktrace() { +void ARM_Interface::LogBacktrace() const { VAddr fp = GetReg(29); VAddr lr = GetReg(30); const VAddr sp = GetReg(13); diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 91d2b0f81c..4dfd41b43a 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h @@ -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 From 3c36de7f43f638ea7252488d9a976812a466ae8a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 30 Dec 2018 20:46:27 -0500 Subject: [PATCH 4/4] arm_interface: Make include path relative for arm_interface.h Makes it consistent with the rest of the includes. --- src/core/arm/arm_interface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/arm/arm_interface.cpp b/src/core/arm/arm_interface.cpp index b0c9a58363..2223cbeed2 100644 --- a/src/core/arm/arm_interface.cpp +++ b/src/core/arm/arm_interface.cpp @@ -2,9 +2,9 @@ // 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 {