sgx_demangle

Rust SGX SDK provides the ability to write Intel SGX applications in Rust Programming Language

3 stable releases

1.1.1 Apr 2, 2020
1.1.0 Dec 19, 2019
1.0.9 Sep 16, 2019
Download history 17/week @ 2024-06-16 15/week @ 2024-06-23 3/week @ 2024-06-30 4/week @ 2024-07-07 19/week @ 2024-07-14 17/week @ 2024-07-21 12/week @ 2024-07-28 24/week @ 2024-08-04 5/week @ 2024-08-11 6/week @ 2024-08-18 9/week @ 2024-08-25 5/week @ 2024-09-01 3/week @ 2024-09-08 3/week @ 2024-09-15 24/week @ 2024-09-22 65/week @ 2024-09-29

95 downloads per month
Used in 7 crates (2 directly)

Custom license

44KB
1K SLoC

Note

Please visit our homepage for usage. Thanks!


lib.rs:

Demangle Rust compiler symbol names.

This crate provides a demangle function which will return a Demangle sentinel value that can be used to learn about the demangled version of a symbol name. The demangled representation will be the same as the original if it doesn't look like a mangled symbol name.

Demangle can be formatted with the Display trait. The alternate modifier (#) can be used to format the symbol name without the trailing hash value.

Examples

use rustc_demangle::demangle;

assert_eq!(demangle("_ZN4testE").to_string(), "test");
assert_eq!(demangle("_ZN3foo3barE").to_string(), "foo::bar");
assert_eq!(demangle("foo").to_string(), "foo");
// With hash
assert_eq!(format!("{}", demangle("_ZN3foo17h05af221e174051e9E")), "foo::h05af221e174051e9");
// Without hash
assert_eq!(format!("{:#}", demangle("_ZN3foo17h05af221e174051e9E")), "foo");

No runtime deps