On Thu, 2016-11-03 at 18:39 +0100, Mark Wielaard wrote: > Adds Rust symbol demangler. Rust mangles symbols using GNU_V3 style, > adding a hash and various special character subtitutions. This adds > a new rust style to cplus_demangle and adds 3 helper functions > rust_demangle, rust_demangle_sym and rust_is_mangled. > > rust-demangle.c was written by David. Mark did the code formatting to > GNU style and integration into the gcc/libiberty build system and > testsuite. > > The original code was written for the perf tool. David agreed with > submitting it for gcc/libiberty so binutils, gdb, valgrind, etc. > can also easily reuse it. He has sent request-assign to ass...@gnu.org. > I already have write after approval for gcc.
Ping. Any comments are welcome. A variant of this is being used already in perf and valgrind. It would be nice to make it part of upstream libiberty. I did also apply this patch to binutils-gdb/libiberty and with a oneliner patch (*) it allows c++filt to handle rust mangled symbols and accept --format=rust (and displays it with --help). I did not yet test gdb, which would need a similar small tweak to its current language settings. Any feedback on whether it also works as expected with gdb appreciated. Thanks, Mark (*) diff --git a/binutils/cxxfilt.c b/binutils/cxxfilt.c index d5863ee..7cf9458 100644 --- a/binutils/cxxfilt.c +++ b/binutils/cxxfilt.c @@ -242,6 +242,7 @@ main (int argc, char **argv) case gnu_v3_demangling: case dlang_demangling: case auto_demangling: + case rust_demangling: valid_symbols = standard_symbol_characters (); break; case hp_demangling: