gimli-rs / cpp_demangle

A crate for demangling C++ symbols

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed demangling for some ApplyGCThingTyped symbols in libxul

mstange opened this issue · comments

cppfilt is unable to demangle these names:

__ZN2js17ApplyGCThingTypedIZNS_8GCMarker12traverseEdgeIPNS_5ShapeEN2JS11PropertyKeyEEEvT_RKT0_EUlTyS7_E_EEbRKS6_OS7_`
__ZZN2js8GCMarker12traverseEdgeIPNS_5ShapeEN2JS11PropertyKeyEEEvT_RKT0_ENKUlTyS6_E_clIP8JSStringEEDaS6_

c++filt demangles them to the following:

bool js::ApplyGCThingTyped<void js::GCMarker::traverseEdge<js::Shape*, JS::PropertyKey>(js::Shape*, JS::PropertyKey const&)::'lambda'<typename $T>(js::Shape*)>(JS::PropertyKey const&, js::Shape*&&)
auto void js::GCMarker::traverseEdge<js::Shape*, JS::PropertyKey>(js::Shape*, JS::PropertyKey const&)::'lambda'<typename $T>(js::Shape*)::operator()<JSString*>(js::Shape*) const

Those symbols don't demangle for me with the latest binutils cxxfilt.

Only llvm-cxxfilt has implemented the new c++20 lambda expressions: https://reviews.llvm.org/rL371273

My c++filt came with macOS 10.15, "GNU c++filt 070207 20070207".

The symbols are produced by the macOS compiler builds installed by mach bootstrap, clang++ --version says clang version 9.0.1.

@mstange that version of c++filt is a fork from apple that is from around ~2005. It internally calls __cxa_demangle which on an apple machine uses llvm's libc++ rather than gcc's libstdc++, so that's why the apple version of c++filt demangles that mangled name.