Python C++ Symbol Demangler

0.3.0 · active · verified Sun Apr 12

Cxxfilt provides a Python interface to demangle C++ symbol names, typically found in compiled binaries or stack traces. It wraps the functionality of system utilities like `c++filt` or `abi::__cxa_demangle`. The current version is 0.3.0, and it is actively maintained on GitHub.

Warnings

Install

Imports

Quickstart

Demangle a common C++ mangled symbol and check the validity of the internal demangler.

import cxxfilt

mangled_symbol = '_ZNSt22condition_variable_anyD2Ev'
demangled_symbol = cxxfilt.demangle(mangled_symbol)
print(f"Mangled: {mangled_symbol}")
print(f"Demangled: {demangled_symbol}")

# To check if the underlying demangler is valid (e.g., if system libraries are present)
# The import itself no longer fails if libraries are missing since v0.3.0.
is_demangler_valid = not isinstance(cxxfilt.default_demangler, cxxfilt.DeferedErrorDemangler)
print(f"Is demangler valid: {is_demangler_valid}")

view raw JSON →