cpp_demangle icon indicating copy to clipboard operation
cpp_demangle copied to clipboard

Failed demangling for some ApplyGCThingTyped symbols in libxul

Open mstange opened this issue 4 years ago • 4 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

mstange avatar May 20 '20 17:05 mstange

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

khuey avatar Jun 09 '20 23:06 khuey

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

Saldivarcher avatar Jun 09 '20 23:06 Saldivarcher

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 avatar Jun 09 '20 23:06 mstange

@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.

Saldivarcher avatar Jun 10 '20 03:06 Saldivarcher