[Bug symtab/34149] [gdb/symtab] Recent regressions

simark at simark dot ca sourceware-bugzilla@sourceware.org
Thu May 14 16:27:35 GMT 2026


https://sourceware.org/bugzilla/show_bug.cgi?id=34149

--- Comment #5 from Simon Marchi <simark at simark dot ca> ---
Ok, so you get:

  warning: Section .debug_names has incorrect entry in CU table, ignoring
.debug_names.

when the test expects:

  During symbol reading: .debug_names entry has bad CU index 1 [in module
.../gdb.dwarf2/debug-names-bad-cu-index/debug-names-bad-cu-index, index entry
for name _start, entry pool offset 0x0]

The "incorrect entry" happens when we scan the CU list, and we find a mismatch
between the CU list in the index and the CUs actually in ".debug_info".  When
you get a FAIL, can you dump the index and the debug info, so we can see what
is the mismatch?  Perhaps that will help understand what happens.

In the working case, I get:


$ readelf --debug-dump=gdb_index
testsuite/outputs/gdb.dwarf2/debug-names-bad-cu-index/debug-names-bad-cu-index 
Contents of the .debug_names section:

Version 5
Augmentation string: 47 44 42 32 00 00 00 00  ("GDB2")
CU table:
[  0] 0

TU table:
[  0] 0

Foreign TU table:

Used 1 of 1 bucket.
Out of 2 items there are 1 bucket clashes (longest of 1 entries).

Symbol table:
[  1] #eddb6232 _start: <0><1> DW_TAG_subprogram DW_IDX_compile_unit=(udata)=1
[  2] #53a2ae86 struct_with_int_member: <0x3><2> DW_TAG_structure_type
DW_IDX_type_unit=(udata)=0
$ readelf --debug-dump=info
testsuite/outputs/gdb.dwarf2/debug-names-bad-cu-index/debug-names-bad-cu-index  
Contents of the .debug_info section:

  Compilation Unit @ offset 0:
   Length:        0x23 (32-bit)
   Version:       4
   Abbrev Offset: 0
   Pointer Size:  8
 <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <c>   DW_AT_language    : (sdata) 2 (non-ANSI C)
 <1><d>: Abbrev Number: 2 (DW_TAG_subprogram)
    <e>   DW_AT_name        : (string) _start
    <15>   DW_AT_low_pc      : (addr) 0x1020
    <1d>   DW_AT_high_pc     : (addr) 0x102e
    <25>   DW_AT_external    : (flag) 1
 <1><26>: Abbrev Number: 0

Contents of the .debug_types section:

  Compilation Unit @ offset 0:
   Length:        0x42 (32-bit)
   Version:       4
   Abbrev Offset: 0x15
   Pointer Size:  8
   Signature:     0x8ece66f4224fddb3
   Type Offset:   0
 <0><17>: Abbrev Number: 1 (DW_TAG_type_unit)
 <1><18>: Abbrev Number: 2 (DW_TAG_structure_type)
    <19>   DW_AT_name        : (string) struct_with_int_member
    <30>   DW_AT_byte_size   : (sdata) 4
 <2><31>: Abbrev Number: 3 (DW_TAG_member)
    <32>   DW_AT_name        : (string) member
    <39>   DW_AT_type        : (ref4) <0x3e>, int
 <2><3d>: Abbrev Number: 0
 <1><3e>: Abbrev Number: 4 (DW_TAG_base_type)
    <3f>   DW_AT_name        : (string) int
    <43>   DW_AT_encoding    : (sdata) 5        (signed)
    <44>   DW_AT_byte_size   : (sdata) 4
 <1><45>: Abbrev Number: 0

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list