summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Kelebek12023-01-13 21:06:13 +0000
committerGravatar Kelebek12023-01-14 04:43:21 +0000
commit80a55c1663ac600103e3d475c1f72b04e2e76f0f (patch)
treeac18dcb7f4714b3324733724edd449c77356345c /src/core
parentMerge pull request #9605 from german77/mouse_mapping (diff)
downloadyuzu-80a55c1663ac600103e3d475c1f72b04e2e76f0f.tar.gz
yuzu-80a55c1663ac600103e3d475c1f72b04e2e76f0f.tar.xz
yuzu-80a55c1663ac600103e3d475c1f72b04e2e76f0f.zip
Add stacktrace symbol demangling
Diffstat (limited to 'src/core')
-rw-r--r--src/core/arm/arm_interface.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/core/arm/arm_interface.cpp b/src/core/arm/arm_interface.cpp
index 2df7b0ee8..a34200539 100644
--- a/src/core/arm/arm_interface.cpp
+++ b/src/core/arm/arm_interface.cpp
@@ -7,8 +7,10 @@
7 7
8#include <map> 8#include <map>
9#include <optional> 9#include <optional>
10
10#include "common/bit_field.h" 11#include "common/bit_field.h"
11#include "common/common_types.h" 12#include "common/common_types.h"
13#include "common/demangle.h"
12#include "common/logging/log.h" 14#include "common/logging/log.h"
13#include "core/arm/arm_interface.h" 15#include "core/arm/arm_interface.h"
14#include "core/arm/symbols.h" 16#include "core/arm/symbols.h"
@@ -71,20 +73,8 @@ void ARM_Interface::SymbolicateBacktrace(Core::System& system, std::vector<Backt
71 const auto symbol_set = symbols.find(entry.module); 73 const auto symbol_set = symbols.find(entry.module);
72 if (symbol_set != symbols.end()) { 74 if (symbol_set != symbols.end()) {
73 const auto symbol = Symbols::GetSymbolName(symbol_set->second, entry.offset); 75 const auto symbol = Symbols::GetSymbolName(symbol_set->second, entry.offset);
74 if (symbol.has_value()) { 76 if (symbol) {
75#ifdef _MSC_VER 77 entry.name = Common::DemangleSymbol(*symbol);
76 // TODO(DarkLordZach): Add demangling of symbol names.
77 entry.name = *symbol;
78#else
79 int status{-1};
80 char* demangled{abi::__cxa_demangle(symbol->c_str(), nullptr, nullptr, &status)};
81 if (status == 0 && demangled != nullptr) {
82 entry.name = demangled;
83 std::free(demangled);
84 } else {
85 entry.name = *symbol;
86 }
87#endif
88 } 78 }
89 } 79 }
90 } 80 }