summaryrefslogtreecommitdiff
path: root/src/core/arm/arm_interface.cpp
diff options
context:
space:
mode:
authorGravatar Liam2022-06-25 12:54:24 -0400
committerGravatar Liam2022-06-25 12:54:24 -0400
commit8f8c0b69dc4d56a0bc29bf8a0e59921334a808a8 (patch)
tree9e2be93615a1af7d43c7080e4073ff3032393d34 /src/core/arm/arm_interface.cpp
parentMerge pull request #8491 from Morph1984/extra-assert (diff)
downloadyuzu-8f8c0b69dc4d56a0bc29bf8a0e59921334a808a8.tar.gz
yuzu-8f8c0b69dc4d56a0bc29bf8a0e59921334a808a8.tar.xz
yuzu-8f8c0b69dc4d56a0bc29bf8a0e59921334a808a8.zip
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 6425e131f..6c9c9d96d 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 }