summaryrefslogtreecommitdiff
path: root/src/core/arm/arm_interface.cpp
diff options
context:
space:
mode:
authorGravatar Mai2022-07-07 23:49:54 -0400
committerGravatar GitHub2022-07-07 23:49:54 -0400
commit313f047f974249c0fa004056ced3f18a8c61eae4 (patch)
tree56d70869ae85bd0dce17923259d25e96be3c98a9 /src/core/arm/arm_interface.cpp
parentMerge pull request #8502 from liamwhite/end-wait (diff)
parentcore/arm: better support for backtrace generation (diff)
downloadyuzu-313f047f974249c0fa004056ced3f18a8c61eae4.tar.gz
yuzu-313f047f974249c0fa004056ced3f18a8c61eae4.tar.xz
yuzu-313f047f974249c0fa004056ced3f18a8c61eae4.zip
Merge pull request #8501 from liamwhite/backtrace-again
core/arm: better support for backtrace generation
Diffstat (limited to 'src/core/arm/arm_interface.cpp')
-rw-r--r--src/core/arm/arm_interface.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/arm/arm_interface.cpp b/src/core/arm/arm_interface.cpp
index 0efc3732f..cef79b245 100644
--- a/src/core/arm/arm_interface.cpp
+++ b/src/core/arm/arm_interface.cpp
@@ -1,6 +1,10 @@
1// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project 1// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later 2// SPDX-License-Identifier: GPL-2.0-or-later
3 3
4#ifndef _MSC_VER
5#include <cxxabi.h>
6#endif
7
4#include <map> 8#include <map>
5#include <optional> 9#include <optional>
6#include "common/bit_field.h" 10#include "common/bit_field.h"
@@ -68,8 +72,19 @@ void ARM_Interface::SymbolicateBacktrace(Core::System& system, std::vector<Backt
68 if (symbol_set != symbols.end()) { 72 if (symbol_set != symbols.end()) {
69 const auto symbol = Symbols::GetSymbolName(symbol_set->second, entry.offset); 73 const auto symbol = Symbols::GetSymbolName(symbol_set->second, entry.offset);
70 if (symbol.has_value()) { 74 if (symbol.has_value()) {
75#ifdef _MSC_VER
71 // TODO(DarkLordZach): Add demangling of symbol names. 76 // TODO(DarkLordZach): Add demangling of symbol names.
72 entry.name = *symbol; 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
73 } 88 }
74 } 89 }
75 } 90 }