DEMANGLE(1) User Commands DEMANGLE(1) NNAAMMEE ddeemmaannggllee - demangle symbols SSYYNNOOPPSSIISS ddeemmaannggllee [--ll _l_a_n_g] [_s_y_m_b_o_l...] DDEESSCCRRIIPPTTIIOONN The ddeemmaannggllee utility attempts to detect mangled symbols and transform them back into a more human friendly version of the symbol. Some languages allow the same identifier to refer to multiple things (functions, variables, etc.) where some additional context such as parameter types, return types, etc. are used to disambiguate between the symbols sharing the same name. When compiling such languages into an executable form, most binary formats do not allow for duplicate symbol names or provide a way to disambiguate between duplicate names. To solve this problem, many languages will use the additional context from the source code to transform the symbol name into a unique name. This process is called name mangling. While the resulting name is predictable, the mangled names are often difficult for humans to interpret. The ddeemmaannggllee utility can be invoked in one of two ways. In the first method, _s_y_m_b_o_l is demangled and the result is written to standard out, one line per input _s_y_m_b_o_l. If any input _s_y_m_b_o_l cannot be demangled, the original value of _s_y_m_b_o_l is output unchanged. In the second method, ddeemmaannggllee reads standard in, and whenever it encounters a potential symbol, it will attempt to replace the symbol in stdandard out with the demangled version. If the symbol cannot be demangled, it is output unchanged. OOPPTTIIOONNSS --ll _l_a_n_g Treat all potential symbols as symbols from _l_a_n_g. By default, ddeemmaannggllee will attempt to detect the language and demangle symbols for all supported languages. Current supported values of _l_a_n_g are: c++ The C++ mangling format defined by the Itanium ABI. While the mangling format was originally defined for the Itanium processor, g++ and clang use this format for all their supported platforms (including x86 and SPARC). rust The legacy rust mangling format. auto Attempt to detect the language automatically (default). EEXXIITT SSTTAATTUUSS The ddeemmaannggllee utility exits 0 on success, and >0 if an error occurs. EEXXAAMMPPLLEESS EExxaammppllee 11 Demangle symbols given as command line arguments. % demangle '_ZGVN9__gnu_cxx16bitmap_allocatorIwE13_S_mem_blocksE' guard variable for __gnu_cxx::bitmap_allocator::_S_mem_blocks % EExxaammppllee 22 Demangle symbols from the output of another command. % grep slice rust.c | head -1 T("__ZN4core5slice89_$LT$impl$u20$core..iter..traits..IntoIterator$u20$for$u20$$RF$$u27$a$u20$$u5b$T$u5d$$GT$9into_iter17h450e234d27262170E", % grep slice rust.c | head -1 | demangle T("core::slice::::into_iter::h450e234d27262170", % IINNTTEERRFFAACCEE SSTTAABBIILLIITTYY The command line options are not stable. The output is uncommitted. illumos February 15, 2020 illumos