Skip to content

Commit

Permalink
libiberty: Support the new ("v0") mangling scheme in rust-demangle
Browse files Browse the repository at this point in the history
This is the libiberty (mainly for binutils/gdb) counterpart of
rust-lang/rustc-demangle#23.

Relevant links for the new Rust mangling scheme (aka "v0"):
* Rust RFC: rust-lang/rfcs#2603
* tracking issue: rust-lang/rust#60705
* implementation: rust-lang/rust#57967

This implementation includes full support for UTF-8 identifiers
via punycode, so I've included a testcase for that as well.

libiberty/ChangeLog
2021-01-16  Eduard-Mihai Burtescu  <eddyb@lyken.rs>

	* rust-demangle.c (struct rust_demangler): Add
	skipping_printing and bound_lifetime_depth fields.
	(eat): Add (v0-only).
	(parse_integer_62): Add (v0-only).
	(parse_opt_integer_62): Add (v0-only).
	(parse_disambiguator): Add (v0-only).
	(struct rust_mangled_ident): Add punycode{,_len} fields.
	(parse_ident): Support v0 identifiers.
	(print_str): Respect skipping_printing.
	(print_uint64): Add (v0-only).
	(print_uint64_hex): Add (v0-only).
	(print_ident): Respect skipping_printing,
	Support v0 identifiers.
	(print_lifetime_from_index): Add (v0-only).
	(demangle_binder): Add (v0-only).
	(demangle_path): Add (v0-only).
	(demangle_generic_arg): Add (v0-only).
	(demangle_type): Add (v0-only).
	(demangle_path_maybe_open_generics): Add (v0-only).
	(demangle_dyn_trait): Add (v0-only).
	(demangle_const): Add (v0-only).
	(demangle_const_uint): Add (v0-only).
	(basic_type): Add (v0-only).
	(rust_demangle_callback): Support v0 symbols.
	* testsuite/rust-demangle-expected: Add v0 testcases.
  • Loading branch information
eddyb authored and tromey committed Jan 16, 2021
1 parent a6006e1 commit f42f69f
Show file tree
Hide file tree
Showing 3 changed files with 1,161 additions and 11 deletions.
28 changes: 28 additions & 0 deletions libiberty/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
2021-01-16 Eduard-Mihai Burtescu <eddyb@lyken.rs>

* rust-demangle.c (struct rust_demangler): Add
skipping_printing and bound_lifetime_depth fields.
(eat): Add (v0-only).
(parse_integer_62): Add (v0-only).
(parse_opt_integer_62): Add (v0-only).
(parse_disambiguator): Add (v0-only).
(struct rust_mangled_ident): Add punycode{,_len} fields.
(parse_ident): Support v0 identifiers.
(print_str): Respect skipping_printing.
(print_uint64): Add (v0-only).
(print_uint64_hex): Add (v0-only).
(print_ident): Respect skipping_printing,
Support v0 identifiers.
(print_lifetime_from_index): Add (v0-only).
(demangle_binder): Add (v0-only).
(demangle_path): Add (v0-only).
(demangle_generic_arg): Add (v0-only).
(demangle_type): Add (v0-only).
(demangle_path_maybe_open_generics): Add (v0-only).
(demangle_dyn_trait): Add (v0-only).
(demangle_const): Add (v0-only).
(demangle_const_uint): Add (v0-only).
(basic_type): Add (v0-only).
(rust_demangle_callback): Support v0 symbols.
* testsuite/rust-demangle-expected: Add v0 testcases.

2020-09-11 Felix Willgerodt <felix.willgerodt@intel.com>

Sync with GCC
Expand Down
Loading

0 comments on commit f42f69f

Please sign in to comment.