Skip to content

Latest commit

 

History

History
84 lines (69 loc) · 1.77 KB

README.md

File metadata and controls

84 lines (69 loc) · 1.77 KB

demangle

A C++ name demangling command-line utility.

Limitations

Only works for mangled symbols that follow the Itanium C++ ABI, like Clang and GCC.

Usage

Symbols to be demangled can be given to stdin or as command line arguments.

Default output follows the format mangled\tdemangled:

3fooIJiEE	foo<int>

Examples:

Symbol passed to stdin.

$ echo 'N3foo3barIJidEEE' | demangle
N3foo3barIJidEEE	foo::bar<int, double>

Symbol passed as command line argument:

$ demangle N3foo3barIJidEEE
N3foo3barIJidEEE	foo::bar<int, double>

Multiple symbols passed to stdin:

$ echo 'i N3foo3barIJidEEE' | demangle
i	int
N3foo3barIJidEEE	foo::bar<int, double>

Multiple symbols passed as command line arguments:

$ demangle i N3foo3barIJidEEE
i	int
N3foo3barIJidEEE	foo::bar<int, double>

Filtering error messages when demangling symbols mixed with other text:

$ echo 'i N3foo3barIJidEEE this_is_not_a_valid_symbol' | demangle 2> /dev/null
i	int
N3foo3barIJidEEE	foo::bar<int, double>

Build requirements

GCC or Clang compiler, any version compatible with C++11.

Installation instructions

Easy mode

Provided you have cmake installed, run ./build.sh install_directory.

./build.sh /usr/local

cmake

Replace $INSTALL_DIRECTORY below with the install directory of your choice.

cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIRECTORY
make install

Build instructions

cmake

mkdir out && cd out
cmake ..
make

Manual build

Assuming $OUT_DIR is the destination directory for the binary:

g++ -Wall -std=c++11 -O3 src/demangle.cpp -o $OUT_DIR/demangle

or

clang++ -Wall -std=c++11 -O3 src/demangle.cpp -o $OUT_DIR/demangle