Skip to content

Commit 906bb4c

Browse files
committed
Fix Rust test cases
PR rust/25025 notes that some Rust test cases fail. Debugging gdb revealed that the Rust compiler emits different linkage names that demangle to the same result. Enabling complaints when reading the test case is enough to show it: During symbol reading: Computed physname <generics::identity<f64>> does not match demangled <generics::identity> (from linkage <_ZN8generics8identity17h8540b320af6656d6E>) - DIE at 0x424 [in module /home/tromey/gdb/build/gdb/testsuite/outputs/gdb.rust/generics/generics] During symbol reading: Computed physname <generics::identity<u32>> does not match demangled <generics::identity> (from linkage <_ZN8generics8identity17hae302fad0c33bd7dE>) - DIE at 0x459 [in module /home/tromey/gdb/build/gdb/testsuite/outputs/gdb.rust/generics/generics] ... This patch changes the DWARF reader to prefer the computed physname, rather than the output of the demangler, for Rust. This fixes the bug. gdb/ChangeLog 2020-04-24 Tom Tromey <[email protected]> PR rust/25025: * dwarf2/read.c (dwarf2_physname): Do not demangle for Rust.
1 parent bcfe615 commit 906bb4c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

gdb/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2020-04-24 Tom Tromey <[email protected]>
2+
3+
PR rust/25025:
4+
* dwarf2/read.c (dwarf2_physname): Do not demangle for Rust.
5+
16
2020-04-24 Tom Tromey <[email protected]>
27

38
PR symtab/12707:

gdb/dwarf2/read.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10318,7 +10318,8 @@ dwarf2_physname (const char *name, struct die_info *die, struct dwarf2_cu *cu)
1031810318
if (!die_needs_namespace (die, cu))
1031910319
return dwarf2_compute_name (name, die, cu, 1);
1032010320

10321-
mangled = dw2_linkage_name (die, cu);
10321+
if (cu->language != language_rust)
10322+
mangled = dw2_linkage_name (die, cu);
1032210323

1032310324
/* DW_AT_linkage_name is missing in some cases - depend on what GDB
1032410325
has computed. */

0 commit comments

Comments
 (0)