Crates.io | cplus_demangle |
lib.rs | cplus_demangle |
version | 0.1.2 |
source | src |
created_at | 2020-09-16 06:45:28.370391 |
updated_at | 2022-04-05 23:52:11.993037 |
description | Rust wrapper for GNU libiberty's cplus_demangle to demangle C++ symbols |
homepage | |
repository | https://github.com/viveksjain/rust_cplus_demangle |
max_upload_size | |
id | 289333 |
size | 6,697 |
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 found.
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)");