Skip to content

Commit

Permalink
Roll back the cxxabi demangle _Z check
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-rifkin committed Feb 3, 2025
1 parent b2180ae commit 8e7b4a9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/demangle/demangle_with_cxxabi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
namespace cpptrace {
namespace detail {
std::string demangle(const std::string& name) {
// https://itanium-cxx-abi.github.io/cxx-abi/abi.html#demangler
// check both _Z and __Z, apple prefixes all symbols with an underscore
if(!(starts_with(name, "_Z") || starts_with(name, "__Z"))) {
return name;
}
// TODO: Do a special check to ensure external names start with _Z?
// // https://itanium-cxx-abi.github.io/cxx-abi/abi.html#demangler
// // check both _Z and __Z, apple prefixes all symbols with an underscore
// if(!(starts_with(name, "_Z") || starts_with(name, "__Z"))) {
// return name;
// }
// Apple clang demangles __Z just fine but gcc doesn't, so just offset the leading underscore
std::size_t offset = 0;
if(starts_with(name, "__Z")) {
Expand Down

0 comments on commit 8e7b4a9

Please sign in to comment.