gimli-rs / cpp_demangle Goto Github PK
View Code? Open in Web Editor NEWA crate for demangling C++ symbols
License: Apache License 2.0
A crate for demangling C++ symbols
License: Apache License 2.0
A debugger does not want to print MyClass::base object constructor
, it wants to print MyClass::MyClass
.
I have no idea how to do this though :) Pointers appreciated.
this symbol will be parsed successfully, unwrap will work, but to_string() will panic!:
let x = cpp_demangle::Symbol::new("_Z18convertCase_helperIN14QUnicodeTables14CasefoldTraitsEtET0_S2_");
println!("{:?}",x);
let y = x.unwrap();
println!("{:?}",y);
let z = y.to_string();
println!("{:?}",z);
results in:
Ok(Symbol { raw: "_Z18convertCase_helperIN14QUnicodeTables14CasefoldTraitsEtET0_S2_", substitutions: SubstitutionTable {0: UnscopedTemplateName(UnscopedTemplateName(Unqualified(Source(SourceName(Identifier { start: 4, end: 22 }))))), 1: Prefix(Unqualified(Source(SourceName(Identifier { start: 26, end: 40 })))), 2: Prefix(Nested(BackReference(1), Source(SourceName(Identifier { start: 42, end: 56 })))), 3: Type(ClassEnum(Named(Nested(NestedName(CvQualifiers { restrict: false, volatile: false, const_: false }, None, BackReference(2)))))), 4: Type(TemplateParam(TemplateParam(1)))}, parsed: Encoding(Function(UnscopedTemplate(BackReference(0), TemplateArgs([Type(BackReference(3)), Type(Builtin(Standard(UnsignedShort)))])), BareFunctionType([BackReference(4), BackReference(3)]))) })
Symbol { raw: "_Z18convertCase_helperIN14QUnicodeTables14CasefoldTraitsEtET0_S2_", substitutions: SubstitutionTable {0: UnscopedTemplateName(UnscopedTemplateName(Unqualified(Source(SourceName(Identifier { start: 4, end: 22 }))))), 1: Prefix(Unqualified(Source(SourceName(Identifier { start: 26, end: 40 })))), 2: Prefix(Nested(BackReference(1), Source(SourceName(Identifier { start: 42, end: 56 })))), 3: Type(ClassEnum(Named(Nested(NestedName(CvQualifiers { restrict: false, volatile: false, const_: false }, None, BackReference(2)))))), 4: Type(TemplateParam(TemplateParam(1)))}, parsed: Encoding(Function(UnscopedTemplate(BackReference(0), TemplateArgs([Type(BackReference(3)), Type(Builtin(Standard(UnsignedShort)))])), BareFunctionType([BackReference(4), BackReference(3)]))) }
thread 'main' panicked at 'a Display implementation return an error unexpectedly: Error', /checkout/src/libcore/result.rs:860
stack backtrace:
0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::_print
at /checkout/src/libstd/sys_common/backtrace.rs:71
2: std::panicking::default_hook::{{closure}}
at /checkout/src/libstd/sys_common/backtrace.rs:60
at /checkout/src/libstd/panicking.rs:355
3: std::panicking::default_hook
at /checkout/src/libstd/panicking.rs:371
4: std::panicking::rust_panic_with_hook
at /checkout/src/libstd/panicking.rs:549
5: std::panicking::begin_panic
at /checkout/src/libstd/panicking.rs:511
6: std::panicking::begin_panic_fmt
at /checkout/src/libstd/panicking.rs:495
7: rust_begin_unwind
at /checkout/src/libstd/panicking.rs:471
8: core::panicking::panic_fmt
at /checkout/src/libcore/panicking.rs:69
9: core::result::unwrap_failed
at /checkout/src/libcore/macros.rs:29
10: <core::result::Result<T, E>>::expect
at /checkout/src/libcore/result.rs:762
11: <T as collections::string::ToString>::to_string
at /checkout/src/libcollections/string.rs:2027
12: cpp_test_demangle::main
at src/main.rs:41
13: __rust_maybe_catch_panic
at /checkout/src/libpanic_unwind/lib.rs:98
14: std::rt::lang_start
at /checkout/src/libstd/panicking.rs:433
at /checkout/src/libstd/panic.rs:361
at /checkout/src/libstd/rt.rs:59
15: main
16: __libc_start_main
17: _start
this symbol should be:
>> c++filt
_Z18convertCase_helperIN14QUnicodeTables14CasefoldTraitsEtET0_S2_
unsigned short convertCase_helper<QUnicodeTables::CasefoldTraits, unsigned short>(unsigned short)
When trying to demangle the symbol
__ZN7ErrorOrIN5lexer5TokenENS0_8LexErrorEEC2IS2_EET_PNSt9enable_ifIXsr3std10is_base_ofIS2_NSt5decayIS5_E4typeEEE5valueEvE4typeE
I get error: demangling some part of the AST attempted to demangle itself again
.
This is a symbol generated by clang++ (c++14), and I think corresponds to something like that:
template <typename E> ErrorOr<lexer::Token, lexer::LexError>::ErrorOr(E, typename enable_if<std::is_base_of<lexer::LexError, typename std::decay<E>::type>::value>::type)
for some value of E (maybe lexer::LexError
?)
Here:
println!("cargo:rerun-if-changed=in/*");
Globs are not expanded by Cargo, they are interpreted literally, meaning this is likely referring to a nonexistent location.
Hello, I am using error-chain
crate, which depends on backtrace
which in turn depends on this crate. So I am not using cpp_demangle
directly, and I don't need the binaries it provides, but cargo still have to compile clap
crate because it is listed in the dependencies. And it takes more than a minute to compile clap
on my setup.
Is there some way to remove clap
from the dependencies when this crate is used as a library?
cargo tree output:
└── error-chain v0.10.0
└── backtrace v0.3.1
├── backtrace-sys v0.1.10
│ └── libc v0.2.23
├── cfg-if v0.1.0
├── cpp_demangle v0.2.2
│ ├── clap v2.24.2
│ │ ├── ansi_term v0.9.0
│ │ ├── atty v0.2.2
│ │ │ └── libc v0.2.23 (*)
│ │ ├── bitflags v0.8.2
│ │ ├── strsim v0.6.0
│ │ ├── term_size v0.3.0
│ │ │ └── libc v0.2.23 (*)
│ │ ├── unicode-segmentation v1.2.0
│ │ ├── unicode-width v0.1.4
│ │ └── vec_map v0.8.0
│ └── fixedbitset v0.1.6
├── libc v0.2.23 (*)
└── rustc-demangle v0.1.4
Have you tried compiling this to asm.js / wasm?
I wonder if the result would be smaller than http://searchfox.org/mozilla-central/source/devtools/client/shared/demangle.js which is 277 KB. If so, I'd like to use it for firefox-devtools/profiler#167.
After #24, and we have some meaningful measures of performance, we should investigate improving those measures.
Filing this now so that I can jot down some ideas floating in the back of my head for posterity:
I can imagine some static optimizations that we apply as new passes over the AST after parsing or during parsing. Things like eagerly resolving substitutions table references, or what set of template args are in scope at what part of the AST.
Being more lazier about various things. Don't even bother determining which template args are (not) in scope if we aren't dealing with a symbol for some kind of template or has a templated parameter. Don't bother with leaf names if we didn't see any constructor or destructor when parsing. Etc.
Remove various uses of dynamic dispatch via trait objects. ArgScope
and ArgScopeStack
would be pretty easy to devirtualize into an enum
. The DemangleAsInner
stack would be harder (and result in such a large enum that it likely would not pay for itself).
We are a naive recursive descent parser right now, would probably be pretty easy to make us blow the stack.
We should
[roc@localhost cpp_demangle]$ target/debug/examples/cppfilt
_ZN7mozilla6detail12ListenerImplINS_14AbstractThreadEZNS_20MediaEventSourceImplILNS_14ListenerPolicyE0EJNS_13TimedMetadataEEE15ConnectInternalIS2_NS_12MediaDecoderEMS8_FvOS5_EEENS_8EnableIfIXsr8TakeArgsIT1_EE5valueENS_18MediaEventListenerEE4TypeEPT_PT0_SD_EUlS9_E_JS5_EE17ApplyWithArgsImplISL_EENSC_IXsr8TakeArgsISH_EE5valueEvE4TypeERKSH_S9_
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
Aborted (core dumped)
E.g.:
echo '_ZN33_$LT$alloc..arc..Arc$LT$T$GT$$GT$9drop_slow17h9ed4cba808ccbc62E' | c++filt
<alloc::arc::Arc<T>>::drop_slow
echo '_ZN33_$LT$alloc..arc..Arc$LT$T$GT$$GT$9drop_slow17h9ed4cba808ccbc62E' | cppfilt
_$LT$alloc..arc..Arc$LT$T$GT$$GT$::drop_slow::h9ed4cba808ccbc62
Strangely, c++filt
agrees with cppfilt
on OSX 🤔 but has output as above on linux...
Doesn't require docker and an old rustc anymore, but does require Linux for now, however.
I guess the fact that this function is a template instance confuses things somehow.
#0 0x00002ab03836004c in WTFCrash () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#1 0x00002ab0359d937d in _ZN7WebCoreL17doSequentialMatchEmON3WTF6VectorINS0_3RefINS_5CacheEEELm0ENS0_15CrashOnOverflowELm16EEEONS0_7VariantIJNS0_6RefPtrINS_12FetchRequestEEENS0_6StringEEEEONS_17CacheQueryOptionsEONS0_8FunctionIFvPNS_13FetchResponseEEEE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#2 0x00002ab0359d9ff2 in _ZN3WTF8FunctionIFvvEE15CallableWrapperIZN7WebCore12CacheStorage5matchEONS_7VariantIJNS_6RefPtrINS4_12FetchRequestEEENS_6StringEEEEONS4_17CacheQueryOptionsEONS_3RefINS4_15DeferredPromiseEEEEUlvE_E4callEv () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#3 0x00002ab0359daa75 in _ZN3WTF8FunctionIFvONS_6VectorIN7WebCore22CacheStorageConnection9CacheInfoELm0ENS_15CrashOnOverflowELm16EEEEE15CallableWrapperIZNS2_12CacheStorage14retrieveCachesEONS0_IFvvEEEEUlS7_E_E4callES7_ () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#4 0x00002ab0344116cf in _ZN7WebCore22CacheStorageConnection12updateCachesEmON3WTF6VectorINS0_9CacheInfoELm0ENS1_15CrashOnOverflowELm16EEE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#5 0x00002ab034163879 in _ZN6WebKit25WebCacheStorageConnection12updateCachesEmON3WTF8ExpectedINS1_6VectorIN7WebCore22CacheStorageConnection9CacheInfoELm0ENS1_15CrashOnOverflowELm16EEENS_18CacheStorageEngine5ErrorEEE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#6 0x00002ab0343f858f in _ZN3IPC13handleMessageIN8Messages25WebCacheStorageConnection12UpdateCachesEN6WebKit25WebCacheStorageConnectionEMS5_FvmON3WTF8ExpectedINS6_6VectorIN7WebCore22CacheStorageConnection9CacheInfoELm0ENS6_15CrashOnOverflowELm16EEENS4_18CacheStorageEngine5ErrorEEEEEEvRNS_7DecoderEPT0_T1_ () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#7 0x00002ab0343f7e88 in _ZN6WebKit25WebCacheStorageConnection17didReceiveMessageERN3IPC10ConnectionERNS1_7DecoderE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#8 0x00002ab033fe5bbb in _ZN3IPC10Connection15dispatchMessageESt10unique_ptrINS_7DecoderESt14default_deleteIS2_EE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#9 0x00002ab033fe6aec in _ZN3IPC10Connection18dispatchOneMessageEv () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#10 0x00002ab038374d00 in _ZN3WTF7RunLoop11performWorkEv () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#11 0x00002ab0383aa979 in _ZZN3WTF7RunLoopC4EvENUlPvE_4_FUNES1_ () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#12 0x00002ab039a975ca in g_main_dispatch () at /home/slave/webkitgtk/gtk-linux-64-release-tests/build/WebKitBuild/DependenciesGTK/Source/glib-2.52.1/glib/gmain.c:3212
#13 g_main_context_dispatch () at /home/slave/webkitgtk/gtk-linux-64-release-tests/build/WebKitBuild/DependenciesGTK/Source/glib-2.52.1/glib/gmain.c:3865
c++filt output
#0 0x00002ab03836004c in WTFCrash () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#1 0x00002ab0359d937d in WebCore::doSequentialMatch(unsigned long, WTF::Vector<WTF::Ref<WebCore::Cache>, 0ul, WTF::CrashOnOverflow, 16ul>&&, WTF::Variant<WTF::RefPtr<WebCore::FetchRequest>, WTF::String>&&, WebCore::CacheQueryOptions&&, WTF::Function<void (WebCore::FetchResponse*)>&&) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#2 0x00002ab0359d9ff2 in WTF::Function<void ()>::CallableWrapper<WebCore::CacheStorage::match(WTF::Variant<WTF::RefPtr<WebCore::FetchRequest>, WTF::String>&&, WebCore::CacheQueryOptions&&, WTF::Ref<WebCore::DeferredPromise>&&)::{lambda()#1}>::call() () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#3 0x00002ab0359daa75 in WTF::Function<void (WTF::Vector<WebCore::CacheStorageConnection::CacheInfo, 0ul, WTF::CrashOnOverflow, 16ul>&&)>::CallableWrapper<WebCore::CacheStorage::retrieveCaches(WTF::Function<void ()>&&)::{lambda(WTF::Vector<WebCore::CacheStorageConnection::CacheInfo, 0ul, WTF::CrashOnOverflow, 16ul>&&)#1}>::call(WTF::Vector<WebCore::CacheStorageConnection::CacheInfo, 0ul, WTF::CrashOnOverflow, 16ul>&&) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#4 0x00002ab0344116cf in WebCore::CacheStorageConnection::updateCaches(unsigned long, WTF::Vector<WebCore::CacheStorageConnection::CacheInfo, 0ul, WTF::CrashOnOverflow, 16ul>&&) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#5 0x00002ab034163879 in WebKit::WebCacheStorageConnection::updateCaches(unsigned long, WTF::Expected<WTF::Vector<WebCore::CacheStorageConnection::CacheInfo, 0ul, WTF::CrashOnOverflow, 16ul>, WebKit::CacheStorageEngine::Error>&&) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#6 0x00002ab0343f858f in void IPC::handleMessage<Messages::WebCacheStorageConnection::UpdateCaches, WebKit::WebCacheStorageConnection, void (WebKit::WebCacheStorageConnection::*)(unsigned long, WTF::Expected<WTF::Vector<WebCore::CacheStorageConnection::CacheInfo, 0ul, WTF::CrashOnOverflow, 16ul>, WebKit::CacheStorageEngine::Error>&&)>(IPC::Decoder&, WebKit::WebCacheStorageConnection*, void (WebKit::WebCacheStorageConnection::*)(unsigned long, WTF::Expected<WTF::Vector<WebCore::CacheStorageConnection::CacheInfo, 0ul, WTF::CrashOnOverflow, 16ul>, WebKit::CacheStorageEngine::Error>&&)) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#7 0x00002ab0343f7e88 in WebKit::WebCacheStorageConnection::didReceiveMessage(IPC::Connection&, IPC::Decoder&) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#8 0x00002ab033fe5bbb in IPC::Connection::dispatchMessage(std::unique_ptr<IPC::Decoder, std::default_delete<IPC::Decoder> >) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#9 0x00002ab033fe6aec in IPC::Connection::dispatchOneMessage() () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#10 0x00002ab038374d00 in WTF::RunLoop::performWork() () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#11 0x00002ab0383aa979 in WTF::RunLoop::RunLoop()::{lambda(void*)#1}::_FUN(void*) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#12 0x00002ab039a975ca in g_main_dispatch () at /home/slave/webkitgtk/gtk-linux-64-release-tests/build/WebKitBuild/DependenciesGTK/Source/glib-2.52.1/glib/gmain.c:3212
#13 g_main_context_dispatch () at /home/slave/webkitgtk/gtk-linux-64-release-tests/build/WebKitBuild/DependenciesGTK/Source/glib-2.52.1/glib/gmain.c:3865
your output
#0 0x00002ab03836004c in WTFCrash () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#1 0x00002ab0359d937d in _Z 0x00002ab0359d937d in _Z0x00002ab0359d937d in _Z00002ab0359d937d in _Z002ab0359d937d in _Z2ab0359d937d in _Zb0359d937d in _Z359d937d in _Z9d937d in _Z937d in _Z7d in _Z in _Zn _Z_ZN7WebCoreL17doSequentialMatchEmON3WTF6VectorINS0_3RefINS_5CacheEEELm0ENS0_15CrashOnOverflowELm16EEEONS0_7VariantIJNS0_6RefPtrINS_12FetchRequestEEENS0_6StringEEEEONS_17CacheQueryOptionsEONS0_8FunctionIFvPNS_13FetchResponseEEEE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#2 0x00002ab0359d9ff2 in _Z 0x00002ab0359d9ff2 in _Z0x00002ab0359d9ff2 in _Z00002ab0359d9ff2 in _Z002ab0359d9ff2 in _Z2ab0359d9ff2 in _Zb0359d9ff2 in _Z359d9ff2 in _Z9d9ff2 in _Z9ff2 in _Zf2 in _Z in _Zn _Z_ZN3WTF8FunctionIFvvEE15CallableWrapperIZN7WebCore12CacheStorage5matchEONS_7VariantIJNS_6RefPtrINS4_12FetchRequestEEENS_6StringEEEEONS4_17CacheQueryOptionsEONS_3RefINS4_15DeferredPromiseEEEEUlvE_E4callEv () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#3 0x00002ab0359daa75 in _Z 0x00002ab0359daa75 in _Z0x00002ab0359daa75 in _Z00002ab0359daa75 in _Z002ab0359daa75 in _Z2ab0359daa75 in _Zb0359daa75 in _Z359daa75 in _Z9daa75 in _Zaa75 in _Z75 in _Z in _Zn _Z_ZN3WTF8FunctionIFvONS_6VectorIN7WebCore22CacheStorageConnection9CacheInfoELm0ENS_15CrashOnOverflowELm16EEEEE15CallableWrapperIZNS2_12CacheStorage14retrieveCachesEONS0_IFvvEEEEUlS7_E_E4callES7_ () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#4 0x00002ab0344116cf in WebCore::CacheStorageConnection::updateCaches(unsigned long, WTF::Vector<WebCore::CacheStorageConnection::CacheInfo&&, 0, WTF::CrashOnOverflow, 16>) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#5 0x00002ab034163879 in WebKit::WebCacheStorageConnection::updateCaches(unsigned long, WTF::Expected<WTF::Vector<WebCore::CacheStorageConnection::CacheInfo&&, 0, WTF::CrashOnOverflow, 16>, WebKit::CacheStorageEngine::Error>) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#6 0x00002ab0343f858f in void IPC::handleMessage<Messages::WebCacheStorageConnection::UpdateCaches(IPC::Decoder&, WebKit::WebCacheStorageConnection*, void (WebKit::WebCacheStorageConnection::*)(unsigned long, WTF::Expected<WTF::Vector<WebCore::CacheStorageConnection::CacheInfo&&, 0, WTF::CrashOnOverflow, 16>, WebKit::CacheStorageEngine::Error>)), WebKit::WebCacheStorageConnection, void (WebKit::WebCacheStorageConnection::*)(unsigned long, WTF::Expected<WTF::Vector<WebCore::CacheStorageConnection::CacheInfo&&, 0, WTF::CrashOnOverflow, 16>, WebKit::CacheStorageEngine::Error>)> () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#7 0x00002ab0343f7e88 in WebKit::WebCacheStorageConnection::didReceiveMessage(IPC::Connection&, IPC::Decoder&) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#8 0x00002ab033fe5bbb in IPC::Connection::dispatchMessage(std::unique_ptr<IPC::Decoder, std::default_delete<IPC::Decoder> >) () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#9 0x00002ab033fe6aec in IPC::Connection::dispatchOneMessage() () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#10 0x00002ab038374d00 in WTF::RunLoop::performWork() () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#11 0x00002ab0383aa979 in _Z1 0x00002ab0383aa979 in _Z0x00002ab0383aa979 in _Z00002ab0383aa979 in _Z002ab0383aa979 in _Z2ab0383aa979 in _Zb0383aa979 in _Z383aa979 in _Z3aa979 in _Za979 in _Z79 in _Z in _Zn _Z_ZZN3WTF7RunLoopC4EvENUlPvE_4_FUNES1_ () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#12 0x00002ab039a975ca in g_main_dispatch () at /home/slave/webkitgtk/gtk-linux-64-release-tests/build/WebKitBuild/DependenciesGTK/Source/glib-2.52.1/glib/gmain.c:3212
#13 g_main_context_dispatch () at /home/slave/webkitgtk/gtk-linux-64-release-tests/build/WebKitBuild/DependenciesGTK/Source/glib-2.52.1/glib/gmain.c:3865
Would it be possible to use this vice-versa to mangle a cpp symbol name?
what I actually want to achieve:
let m = dlopen("libQt5Core.so", RTL_LAZY );
let symbol = Symbol::fromName( "QString::fromUtf16(unsigend short const*, int)" );
// symbol.magle() -> "_ZN7QString9fromUtf16EPKti"
let thecppfunc = dlsym(m, symbol.mangle());
This generates an Err(UnexpectedText)
:
let sym = "_ZN5boost9unordered18unordered_multimapItN3xxx6xxxxxx6xxxxxx14xxxxxxxxxxxxxxENS_4hashItEESt8equal_toItESaISt4pairIKtS5_EEE7emplaceIISC_EEENS0_15iterator_detail8iteratorINS0_6detail16grouped_ptr_nodeISC_EEEEDpOT_";
println!( "{:?}", cpp_demangle::Symbol::new( sym ) );
Using c++filt
works:
boost::unordered::iterator_detail::iterator<boost::unordered::detail::grouped_ptr_node<std::pair<unsigned short const, xxx::xxxxxx::xxxxxx::xxxxxxxxxxxxxx> > > boost::unordered::unordered_multimap<unsigned short, xxx::xxxxxx::xxxxxx::xxxxxxxxxxxxxx, boost::hash<unsigned short>, std::equal_to<unsigned short>, std::allocator<std::pair<unsigned short const, xxx::xxxxxx::xxxxxx::xxxxxxxxxxxxxx> > >::emplace<std::pair<unsigned short const, xxx::xxxxxx::xxxxxx::xxxxxxxxxxxxxx> >(std::pair<unsigned short const, xxx::xxxxxx::xxxxxx::xxxxxxxxxxxxxx>&&)
Discovered through the test suite of backtrace-rs it looks like the symbol _ZN5space20templated_trampolineIPFvvEEEvT_
is no longer demangled as void space::templated_trampoline<void (*)()>(void (*)())
I believe?
I came across this symbol which does not demangle:
_ZL29SupportsTextureSampleCountMTLPU19objcproto9MTLDevice11objc_objectm
With an extra underscore c++filt does this:
SupportsTextureSampleCountMTL(id<MTLDevice>, unsigned long)
Seems like this shouldn't happen :)
Since the demangled symbol's length can be exponential in the worst case, we should allow users to clamp it down.
For example, this mangled symbol
__Z20lets_get_exponentialP4PairIS_IS_IS_IS_IS_IS_IS_IiiES0_ES1_ES2_ES3_ES4_ES5_ES6_E
Demangles into this:
lets_get_exponential(Pair<Pair<Pair<Pair<Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > >, Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > > >, Pair<Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > >, Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > > > >, Pair<Pair<Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > >, Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > > >, Pair<Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > >, Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > > > > >, Pair<Pair<Pair<Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > >, Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > > >, Pair<Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > >, Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > > > >, Pair<Pair<Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > >, Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > > >, Pair<Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > >, Pair<Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > >, Pair<Pair<Pair<int, int>, Pair<int, int> >, Pair<Pair<int, int>, Pair<int, int> > > > > > > >*)
This would be the tail.index()
or input.index()
where we first saw some unexpected text.
I got a stack overflow error:
$ cppfilt '_ZNSt3__116forward_as_tupleIJRKZN11tconcurrent6detail6sharedIFvvEEC1IZNS1_7yielder13await_suspendINS1_12task_promiseIvEEEEvNSt12experimental13coroutines_v116coroutine_handleIT_EEEUlvE_EEbNS_10shared_ptrINS1_17cancelation_tokenEEEOSE_PvEUlRSI_DpOT_E_EEENS_5tupleIJSP_EEESP_'
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
[1] 7892 abort (core dumped) cppfilt
Here are a couple iterations of the recursion loop:
#39889 cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=<optimized out>, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:5870
#39890 cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=0x7faa52e89070, ctx=<optimized out>, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:1939
#39891 0x00005555555683a8 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /checkout/src/libcore/result.rs:1170
#39892 0x00005555555720de in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:1279
#39893 0x000055555557255f in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=<optimized out>, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:5756
#39894 cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=0x7faa52e75608, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:1284
#39895 0x0000555555572e31 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /checkout/src/libcore/ptr.rs:59
#39896 0x0000555555568e1a in cpp_demangle::subs::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/subs.rs:41
#39897 0x000055555556666d in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:840
#39898 0x00005555555729f2 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=0x7faa52e756c8, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:2791
#39899 0x0000555555568e1a in cpp_demangle::subs::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/subs.rs:41
#39900 0x000055555556666d in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:840
#39901 0x0000555555572642 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=0x7faa52e75798, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:2801
#39902 0x0000555555568e1a in cpp_demangle::subs::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/subs.rs:41
#39903 0x000055555556666d in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:840
#39904 0x00005555555672e1 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:4189
#39905 0x00005555555673cb in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:4198
#39906 0x000055555556850a in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:3895
#39907 0x0000555555572904 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:2783
#39908 0x0000555555568e1a in cpp_demangle::subs::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/subs.rs:41
#39909 0x000055555556666d in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:840
#39910 0x0000555555572642 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=0x7faa52e75458, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:2801
#39911 0x0000555555568e1a in cpp_demangle::subs::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/subs.rs:41
#39912 0x000055555556666d in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:840
#39913 0x00005555555726d0 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:2827
#39914 0x0000555555568e1a in cpp_demangle::subs::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/subs.rs:41
#39915 0x000055555556666d in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:840
#39916 0x0000555555569aeb in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=<optimized out>, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:5924
#39917 cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=<optimized out>, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:5870
#39918 cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=0x7faa52e89070, ctx=<optimized out>, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:1939
#39919 0x00005555555683a8 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /checkout/src/libcore/result.rs:1170
#39920 0x00005555555720de in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:1279
#39921 0x000055555557255f in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=<optimized out>, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:5756
#39922 cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=0x7faa52e75608, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:1284
#39923 0x0000555555572e31 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /checkout/src/libcore/ptr.rs:59
#39924 0x0000555555568e1a in cpp_demangle::subs::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/subs.rs:41
#39925 0x000055555556666d in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:840
#39926 0x00005555555729f2 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=0x7faa52e756c8, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:2791
#39927 0x0000555555568e1a in cpp_demangle::subs::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/subs.rs:41
#39928 0x000055555556666d in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:840
#39929 0x0000555555572642 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=0x7faa52e75798, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:2801
#39930 0x0000555555568e1a in cpp_demangle::subs::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/subs.rs:41
#39931 0x000055555556666d in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:840
#39932 0x00005555555672e1 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:4189
#39933 0x00005555555673cb in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:4198
#39934 0x000055555556850a in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:3895
#39935 0x0000555555572904 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:2783
#39936 0x0000555555568e1a in cpp_demangle::subs::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/subs.rs:41
#39937 0x000055555556666d in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:840
#39938 0x0000555555572642 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=0x7faa52e75458, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:2801
#39939 0x0000555555568e1a in cpp_demangle::subs::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/subs.rs:41
#39940 0x000055555556666d in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:840
#39941 0x00005555555726d0 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:2827
#39942 0x0000555555568e1a in cpp_demangle::subs::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/subs.rs:41
#39943 0x000055555556666d in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:840
#39944 0x00005555555672e1 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:4189
#39945 0x00005555555673cb in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:4198
#39946 0x00005555555681a5 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:4096
#39947 0x0000555555569442 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=<optimized out>, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:1828
#39948 cpp_demangle::subs::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/subs.rs:44
#39949 0x0000555555567ead in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:865
#39950 0x00005555555662bf in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=0x7faa52e75950, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:1517
#39951 0x0000555555572018 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:1278
#39952 0x0000555555572e31 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /checkout/src/libcore/ptr.rs:59
#39953 0x0000555555568e1a in cpp_demangle::subs::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/subs.rs:41
#39954 0x000055555556666d in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:840
#39955 0x0000555555561fa8 in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=0x7fffffffcc38, ctx=0x7fffffffccb0, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:1093
#39956 0x000055555557355a in cpp_demangle::ast::{{impl}}::demangle<&mut alloc::vec::Vec<u8>> (self=<optimized out>, ctx=<optimized out>, stack=...) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/ast.rs:1010
#39957 cpp_demangle::Symbol<&[u8]>::demangle<&[u8]> (self=<optimized out>, options=<optimized out>) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/lib.rs:175
#39958 cppfilt::demangle_line<std::io::stdio::StdoutLock> (out=<optimized out>, line=..., options=0x7fffffffd8d0) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/bin/cppfilt.rs:47
#39959 0x00005555555742bc in cppfilt::demangle_all<std::io::cursor::Cursor<alloc::string::String>,std::io::stdio::StdoutLock> (input=<optimized out>, out=<optimized out>, options=<optimized out>) at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/bin/cppfilt.rs:69
#39960 cppfilt::main () at /home/blastrock/.cargo/registry/src/github.com-1ecc6299db9ec823/cpp_demangle-0.2.7/src/bin/cppfilt.rs:113
#39961 0x00005555555f415d in panic_unwind::__rust_maybe_catch_panic () at /checkout/src/libpanic_unwind/lib.rs:99
#39962 0x00005555555edb7c in std::panicking::try<(),closure> () at /checkout/src/libstd/panicking.rs:459
#39963 std::panic::catch_unwind<closure,()> () at /checkout/src/libstd/panic.rs:361
#39964 std::rt::lang_start () at /checkout/src/libstd/rt.rs:59
#39965 0x00007faa5329fa87 in __libc_start_main (main=0x5555555748a0 <main>, argc=2, argv=0x7fffffffdbd8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdbc8) at ../csu/libc-start.c:310
#39966 0x0000555555561c8a in _start ()
Mangled name:
_ZNSt3__18__invokeIZN13CallBackTimer5startEiNS_8functionIFvvEEEEUlvE_JEEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOS6_DpOS7_
libiberty:
_ZNSt3__18__invokeIZN13CallBackTimer5startEiNS_8functionIFvvEEEEUlvE_JEEEDTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOS6_DpOS7_
cppfilt:
std::__1::__invoke<CallBackTimer::start(int, std::__1::function<void ()>)::{lambda()#1}, >DTclclsr3std3__1E7forwardIT_Efp_Espclsr3std3__1E7forwardIT0_Efp0_EEEOS6_DpOS7_
llvm-cxxfilt:
decltype(std::__1::forward<CallBackTimer::start(int, std::__1::function<void ()>)::'lambda'()>(fp)()) std::__1::__invoke<CallBackTimer::start(int, std::__1::function<void ()>)::'lambda'()>(CallBackTimer::start(int, std::__1::function<void ()>)::'lambda'()&&)
Which is apparently easier to use than afl.rs
What is the license of this software? Is it possible to have it in the GPL flavor?
Compiling cpp_demangle v0.2.7 (file:///home/fitzgen/cpp_demangle)
warning: type annotations needed
--> src/ast.rs:3917:18
|
3917 | self_ptr.hash(state);
| ^^^^
|
= note: #[warn(tyvar_behind_raw_pointer)] on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
= note: for more information, see issue #46906 <https://github.com/rust-lang/rust/issues/46906>
When I try to demangle this string, I get:
thread 'main' panicked at 'a Display implementation return an error unexpectedly: Error', libcore/result.rs:945:5
c++filt is ok and returns:
TestLargestRegion::TestNonRectangular()::{unnamed type#1}::~TestNonRectangular()
Libiberty contains a good set of demangler test cases, including various manglings that have crashed the libiberty demangler. (There are still some other known crashers in gcc and gdb bugzilla though; and also at one point Gary Benson had a fuzzer...)
You can see the libiberty tests here:
https://gcc.gnu.org/viewcvs/gcc/trunk/libiberty/testsuite/
You want demangle-expected
but there are also tests for Rust that might be interesting.
Ian's demangler in Go (https://github.com/ianlancetaylor/demangle) uses this test suite as well, though it seems to be a bit behind libiberty master.
The tests are presumably GPL (no explicit license there, but in ancient times I extracted them from the gdb test suite into this file), but I think that shouldn't matter.
E.g. cppfilt -p
demangles _ZNK2cc13LayerTreeImpl25current_page_scale_factorEv
to
cc::LayerTreeImpl::current_page_scale_factor const
but c++filt -p
demangles it to
cc::LayerTreeImpl::current_page_scale_factor
The latter makes more sense since the const
is associated with the implicit this
parameter.
$ cargo install cpp_demangle
The following error messages are displayed:
Updating registry `https://github.com/rust-lang/crates.io-index`
Compiling cpp_demangle v0.2.0
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:323:18: 323:19 error: unexpected `?`
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:323 where D: ?Sized + Demangle,
^
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:343:19: 343:20 error: unexpected `?`
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:343 where T: 'a + ?Sized,
^
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:344:19: 344:20 error: unexpected `?`
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:344 U: 'b + ?Sized;
^
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:347:19: 347:20 error: unexpected `?`
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:347 where T: 'a + ?Sized + Demangle,
^
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:348:19: 348:20 error: unexpected `?`
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:348 U: 'b + ?Sized + Demangle
^
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:968:18: 968:19 error: unexpected `?`
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:968 where D: ?Sized + Demangle,
^
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:1892:18: 1892:19 error: unexpected `?`
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:1892 where D: ?Sized + Demangle,
^
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:1921:30: 1921:31 error: unexpected `?`
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:1921 where D: ?Sized + Demangle,
^
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:2278:18: 2278:19 error: unexpected `?`
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:2278 where D: ?Sized + Demangle,
^
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:2326:18: 2326:19 error: unexpected `?`
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:2326 where D: ?Sized + Demangle,
^
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:2572:18: 2572:19 error: unexpected `?`
$HOME/.cargo/registry/src/github.com-88ac128001ac3a9a/cpp_demangle-0.2.0/src/ast.rs:2572 where D: ?Sized + Demangle,
^
In libiberty, Rust demangling is basically just C++ demangling with an extra pass to do some extra Rust wrangling. I think it might be useful to add this mode to cpp_demangle as well. (Another idea might be to have a separate rust demangler crate that internally uses cpp_demangle; this would keep options open if the rust demangling ever changes.)
#127 puts off unnamed types' constructors and destructors since I haven't seen a real symbol that has that yet. Would need to add another LeafName
variant.
Running the following symbol through c++filt
, demangle.go
, and my system __cxa_demangle
, I see what looks to be the same bug in libiberty
as lambda constructors/destructors.
demangles!(
_ZZ3aaavENUt_D1Ev,
"aaa()::{unnamed type#1}::~{unnamed type#1}()"
);
I don't know if it's in scope, but it would be nice to have demangling for MSVC C++ names as well. It's not officially documented, but there is a fair bit of info out there about it:
https://en.wikiversity.org/wiki/Visual_C%2B%2B_name_mangling
http://www.kegel.com/mangle.html
Wine has an (LGPL) implementation of undname:
http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/msvcrt/undname.c
clang has support for generating MSVC-compatible mangled names:
https://github.com/llvm-mirror/clang/blob/966fedc25951ad35732cb9e175decf271dc3ed09/lib/AST/MicrosoftMangle.cpp
and it has some tests for it as well:
https://github.com/llvm-mirror/clang/blob/a0badfbffbee71c2c757d580fc852d2124dadc5a/test/CodeGenCXX/mangle-ms.cpp
These inputs cause panics and/or crashes:
__Z13Jh_SetEle2Cont99999999999999999999999999999bjJSStringEE
__Z144444444444444444444SContextN2JS6HandleIP8JSObjectEEjNS2_IP8JSStringEE
__Z13JS_SetElementP9JSContextN2JS6HandlKI3333333333333333333333333333EE
__Z1_zZ1SesxtK2SSSSSSSSSSSSSSSSSSSSJS6Haject
__Z12NoteWeakEdgeIN2js3jSSSSSSSSSSSSSSSSSSSSSS__ZTVttC~deEEvPNS0_8GCMerEPPT_
__Z19JS_CopyPropertyFromP9JSContextN2JS6HandleI4jsidEENS2_I19JS_CopyPropertyFromP9JSContextN2JS6HandleI4jsidEENS2CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCyCopyBehavior
__Z11CallObjFuncPFTentSCRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRbES
__Z11CallObjFuncPFTsntSCRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRbES
__Z11CallObjFuncPFbOOjSCRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRbES
__Z10IsIteratorM2JS6HandlrM2JrM2JS6CCCCCCCCS6CCCCCCCCQCCCCCCCtMS_$
__Z10IsIteatorN2JS6IandleIJA_5ValueErorN2JS6IandleIJA_5ValueEratorN2JS6IAndle777777777777777770777777777A_5ValueEEE
__Z1IT_IterFterFtU2JIItElterFtorF2JSVVVVVVVVViVVVVVVVVV66HllllllllloroaU2lllllllloroaU2JIterFt4IterFterFtU2JIItElterFtorF2JSVVVVVVVVVRVVVVVVVVV66HlwllllllloroaU2lllllllloroaU2JIterFt4_IrU2JIItElterFtorF2J_IrU2JI_IrU2JIItElterFtorF2J_IrU2JIItElte
These inputs cause hangs:
__Z17JS_SetArrayLengt(P9JSContextN2JS6HandleIP8JSObjectEEj
__Z26JS_MRAT__olveStandardClassRK11JSAtomState4jsidP8JSObject
__Z13ConvertToBaseIPN2js17EnvironmentObjectEEPN13PtrBiseGCTypeIT_E4typeEPS4_
__Z16JS_ConcatStringRAT__ContextN2JS6HandleIP8JSStringEES5_
__Z1_zZ1SetEsemZ1_z1_fZ1SZ1_zZ1SetEseEleZ1SetEseElenetEsemZ1_z1_zZ1GetEsemZ1_zZ1SetEseElentx9Z1XetE9etE9
__Z10IsIteatorN2JS6IandleIJA_5ValueErorN2JS6IandlehJA_5ValueEratorN2JS6IAndleIJA_5ValueatorN2JS6IAndleIJA_5ValueEEE
__Z19JS_DeZ1_zUCPropertyP9JSContextN2JS6HandleIP8JSObjectEEPKDsmijPFjPNS1_5ValueEESB
There's a bunch more of both panics/crashes and hangs, and a bunch which have non-ascii and non-utf-8 bytes, and therefore aren't amenable to being pasted into a github issue.
Here is a zip of everything AFL found overnight: afl.zip
mangled: _ZN4base8internal13FunctorTraitsIPFvvEvE6InvokeIJEEEvS3_DpOT_
c++filt: void base::internal::FunctorTraits<void (*)(), void>::Invoke<>(void (*)())
cpp_demangle: void base::internal::FunctorTraits<void (*)(), void>::Invoke<>(void (*)(), &&...)
Also, the no_params
option has no effect on this symbol. I haven't tested yet what happens with a non-empty argarg template.
When demangling the symbols of one of our applications the cpp_demangle
manages to demangle everything besides symbols like these which generate an Err(UnexpectedText)
:
let sym = "_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag.isra.90";
println!( "{:?}", cpp_demangle::Symbol::new( sym ) );
Using c++filt
works:
void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag) [clone .isra.90]
The problem here is the postfix .isra.90
which should result in [clone .isra.90]
in the demangled symbol, which isn't supported by cpp_demangle
.
I see that the libiberty's test_libiberty_demangle_172
from #16 is similar to this, so this is technically a duplicate, but I guess it might be worthwhile to have separate issues to help prioritize the cases which actually pop up in real production binaries?
See rust-fuzz/afl.rs#105 for context
There are still a lot of symbols that fail demangling. This is fine as cppfilt still works better than c++filt in my opinion. However, when demangling lots of symbols in a file or stdin, cppfilt will abort on the first symbol it can't demangle.
When cppfilt encounters an symbol it can't demangle, I think it should just print it mangled, as c++filt does, and continue demangling the rest of the symbols.
https://github.com/gimli-rs/cpp_demangle/blob/master/tests/libxul.txt is pretty large. This file is being included in the published crate on crates.io, and it doesn't really need to be.
mach vendor rust
complains about this file when I try to vendor cpp_demangle
into Firefox. (It also complains about ast.rs
.)
<kats> mstange: adding `exclude = ["tests/**"]` to the Cargo.toml package section and republishing should help
_ZN7mozilla3gfx12RecordedFillC2INS0_11EventStreamEEERT_
expected:
mozilla::gfx::RecordedFill::RecordedFill<mozilla::gfx::EventStream>(mozilla::gfx::EventStream&)
actual:
mozilla::gfx::EventStream& mozilla::gfx::RecordedFill::RecordedFill<mozilla::gfx::EventStream>()
Similar to the is_template
checks that exist, probably need is_ctor_dtor
as well.
failed to match libiberty's demangling: _ZnwmRKSt9nothrow_t
...we demangled to: operatornew(unsigned long, std::nothrow_t const&)
...libiberty demangled to: operator new(unsigned long, std::nothrow_t const&)
This symbol:
_ZZN12_GLOBAL__N_15helloEvENK3$_0clEv
Comes from
namespace {
int hello() {
([] { printf("test"); })();
return 0;
}
}
Not sure what it should demangle to as c++filt also has problems with it.
c++filt should accept --help
and --version
flags and DTRT.
I got this from ianlancetaylor/demangle#3
pokyo. ./target/debug/cppfilt
_Z1jI1AEDTcldtfp_cvPT_EES1_
j<A>DTcldtfp_cvPT_EES1_
But the right answer is:
pokyo. c++filt _Z1jI1AEDTcldtfp_cvPT_EES1_
decltype (({parm#1}.(operator A*))()) j<A>(A)
or something like that -- llvm differs here and that "parm#1" seems suspicious.
As seen on a recent libxul: _ZN7mozilla5xpcom16GetServiceHelperCI2NS0_18StaticModuleHelperEENS0_8ModuleIDEP8nsresult
khuey@minbar:~/dev/cpp_demangle$ c++filt -v
GNU c++filt (GNU Binutils) 2.29.51
Copyright (C) 2018 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
khuey@minbar:~/dev/cpp_demangle$ c++filt _ZN7mozilla5xpcom16GetServiceHelperCI2NS0_18StaticModuleHelperEENS0_8ModuleIDEP8nsresult
mozilla::xpcom::GetServiceHelper::StaticModuleHelper(mozilla::xpcom::ModuleID, nsresult*)
Not sure if this is a cpp_demangle issue or a cargo issue, but we'll start here. If I create an empty binary project and put
cpp_demangle = "0.2.8"
in the dependencies, cpp_demangle will rebuild every time I cargo build
.
But if I put
cpp_demangle = { git = "https://github.com/gimli-rs/cpp_demangle" }
It works as expected.
Don't have time to dig in at the moment, unfortunately.
This is just an idea.
I've had some success in the past setting up an AFL job which runs 2 different parsers in tandem and deliberately fails when the results differ. This can be useful in finding out if they interpret the official spec differently.
Demangling '_Z4funcINS_6ObjectEENS0_IT_EEi'
libiberty: func::Object<func::Object> func<func::Object>(int)
demangle.go: func::Object<func::Object> func<func::Object>(int)
cpp_demangle: func<func::Object>NS0_IT_EEi
Demangling '_ZN4funcINS_6ObjectEEENS0_IT_EEi'
libiberty: func::Object<func::Object> func<func::Object>(int)
demangle.go: func::Object<func::Object> func<func::Object>(int)
cpp_demangle: func<func::Object>NS0_IT_EEi
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.