Skip to content

viveksjain/rust_cplus_demangle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cplus_demangle

cplus_demangle

crates.io docs.rs

This library converts C++ mangled symbol names to human-readable strings. It is a safe Rust wrapper to GNU libiberty's C function cplus_demangle. I found it much faster and more robust than other Rust-native implementations that I checked.

Example

Suppose you compile the following C++ program:

namespace test {
  void myfn(int x) { }
}

In the resulting binary, the symbol that gets generated for myfn is _ZN4test4myfnEi. We can convert it back with this Rust code:

assert_eq!(cplus_demangle::demangle("_ZN4test4myfnEi").unwrap(), "test::myfn(int)");

About

Rust wrapper for GNU libiberty's cplus_demangle

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published