-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rust symbol demangling #110
Comments
Shifting the discussion to this issue..
That would be indeed nicer, but I'm not sure if it is easily achievable, because Rust and C++ manglings are so similar. I'm not expert on this, so do not take my word on this, but testing shortsymbols/fullsymbols on a Rust executable results partial demangling:
|
An annoying user-visible piece of this is that Rust symbols have a hash suffix on them (to allow linking multiple major versions of the same crate into the same binary, if desired), you can see the n.b. the current in-use Rust mangling scheme is backwards-compatible with Itanium C++ name mangling for compatibility reasons. However, there's a Rust Symbol Mangling (v0) RFC which has not yet stabilized that specifies a Rust-specific mangling that is unambiguous. |
Are there any further updates on this? |
This came up in HN discussion that Bloaty does not have currently demangling for Rust symbols, and such feature would be useful.
There are at least two different libraries that implement Rust demangling:
GNU libiberty: https://github.com/gcc-mirror/gcc/blob/master/libiberty/rust-demangle.c
rustc-demangle: https://github.com/alexcrichton/rustc-demangle
The latter has the downside of being implemented in Rust, so a small wrapper is needed to make it work with C++ code. Might need bit of work to make it play with CMake nicely.
I have made a quick proof of concept version based on rustc-demangle here: https://github.com/zokier/bloaty/tree/rust_demangle
The text was updated successfully, but these errors were encountered: