diff options
author | Mai <mathew1800@gmail.com> | 2022-07-08 05:49:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-08 05:49:54 +0200 |
commit | 313f047f974249c0fa004056ced3f18a8c61eae4 (patch) | |
tree | 56d70869ae85bd0dce17923259d25e96be3c98a9 /src/core/arm/arm_interface.cpp | |
parent | Merge pull request #8502 from liamwhite/end-wait (diff) | |
parent | core/arm: better support for backtrace generation (diff) | |
download | yuzu-313f047f974249c0fa004056ced3f18a8c61eae4.tar yuzu-313f047f974249c0fa004056ced3f18a8c61eae4.tar.gz yuzu-313f047f974249c0fa004056ced3f18a8c61eae4.tar.bz2 yuzu-313f047f974249c0fa004056ced3f18a8c61eae4.tar.lz yuzu-313f047f974249c0fa004056ced3f18a8c61eae4.tar.xz yuzu-313f047f974249c0fa004056ced3f18a8c61eae4.tar.zst yuzu-313f047f974249c0fa004056ced3f18a8c61eae4.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/arm/arm_interface.cpp | 15 |
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 @@ // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#ifndef _MSC_VER +#include <cxxabi.h> +#endif + #include <map> #include <optional> #include "common/bit_field.h" @@ -68,8 +72,19 @@ void ARM_Interface::SymbolicateBacktrace(Core::System& system, std::vector<Backt if (symbol_set != symbols.end()) { const auto symbol = Symbols::GetSymbolName(symbol_set->second, entry.offset); if (symbol.has_value()) { +#ifdef _MSC_VER // TODO(DarkLordZach): Add demangling of symbol names. entry.name = *symbol; +#else + int status{-1}; + char* demangled{abi::__cxa_demangle(symbol->c_str(), nullptr, nullptr, &status)}; + if (status == 0 && demangled != nullptr) { + entry.name = demangled; + std::free(demangled); + } else { + entry.name = *symbol; + } +#endif } } } |