With test-case gdb.dwarf2/struct-with-sig.exp and target board cc-with-debug-names I run into: ... (gdb) ptype struct s^M /home/vries/gdb_versions/devel/src/gdb/dwarf2/read.c:3963: internal-error: dw2_expand_symtabs_matching_one: Assertion `symtab != nullptr' failed.^M A problem internal to GDB has been detected,^M further debugging may prove unreliable.^M ----- Backtrace -----^M FAIL: gdb.dwarf2/struct-with-sig.exp: struct s with int i (GDB internal error) ... This is easily enough fixed by: ... diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 017cde0dcd9..97be0aaa0db 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -3960,9 +3960,8 @@ dw2_expand_symtabs_matching_one compunit_symtab *symtab = dw2_instantiate_symtab (per_cu, per_objfile, false); - gdb_assert (symtab != nullptr); - if (expansion_notify != NULL && symtab_was_null) + if (symtab != nullptr && expansion_notify != NULL && symtab_was_null) return expansion_notify (symtab); } return true; ... Still, we're trying to print struct s, in the context of main, which has a struct s decl with sig reference to a struct s in a TU. So why are we're trying to instantiate the dummy CU at offset 0x9a: ... Compilation Unit @ offset 0x8f: Length: 0x7 (32-bit) Version: 4 Abbrev Offset: 0x59 Pointer Size: 8 Compilation Unit @ offset 0x9a: ... which contains no symbols and is indeed not listed as containing any symbols in the .debug_names index? Is this because the index is missing information? That is, it has: ... [ 15] #0002b618 s: <5> DW_TAG_structure_type DW_IDX_type_unit=0 DW_IDX_GNU_internal=1 <5> DW_TAG_structure_type DW_IDX_type_unit=1 DW_IDX_GNU_internal=1 ... but there's no indication that the foo and main compilation units also contain those types (using aforementioned decl-with-sig-ref).
No longer fails with the tentative fix for PR29334, so probably a duplicate.
No longer fails on master, marking as duplicate. *** This bug has been marked as a duplicate of bug 29334 ***