]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Add missing type_offset in gdb.dwarf/debug-names-tu.exp
authorTom de Vries <tdevries@suse.de>
Sat, 23 May 2026 08:16:57 +0000 (10:16 +0200)
committerTom de Vries <tdevries@suse.de>
Sat, 23 May 2026 08:16:57 +0000 (10:16 +0200)
With llvm-dwarfdump we run into this warning:
...
$ llvm-dwarfdump -a -v debug-names-tu > /dev/null
warning: DWARF type unit at offset 0x00000028 has its relocated type_offset \
  0x00000028 pointing inside the header
...

Fix this by adding the missing type_offset.

Likewise in gdb.dwarf2/debug-names-bad-cu-index.exp.

Approved-By: Tom Tromey <tom@tromey.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34157

gdb/testsuite/gdb.dwarf2/debug-names-bad-cu-index.exp
gdb/testsuite/gdb.dwarf2/debug-names-tu.exp.tcl

index 10e649f06afe4fa6d5a2dcf4f55c06392e697f27..5d31414ba293e8e866b7b83167ad8c37f7d17cf2 100644 (file)
@@ -34,6 +34,8 @@ Dwarf::assemble {
        global $var
     }
 
+    declare_labels type_offset
+
     cu { label cu_label } {
        compile_unit {
            DW_AT_language @DW_LANG_C
@@ -47,11 +49,11 @@ Dwarf::assemble {
        }
     }
 
-    tu { label tu_label } 0x8ece66f4224fddb3 "" {
+    tu { label tu_label } 0x8ece66f4224fddb3 type_offset {
        type_unit {} {
            declare_labels int_type
 
-           structure_type {
+           type_offset: structure_type {
                DW_AT_name struct_with_int_member
                DW_AT_byte_size 4 sdata
            } {
index af3f263a2733746e540f7f0a086576b0315f481b..bd48df6a894d637202f6773ad2cc622abc96b3bd 100644 (file)
@@ -39,6 +39,8 @@ Dwarf::assemble {
        global $var
     }
 
+    declare_labels type_label
+
     cu { label cu_label version $dwarf_version } {
        compile_unit {
            DW_AT_language @DW_LANG_C
@@ -52,13 +54,13 @@ Dwarf::assemble {
        }
     }
 
-    tu { label tu_label version $dwarf_version } 0x8ece66f4224fddb3 "" {
+    tu { label tu_label version $dwarf_version } 0x8ece66f4224fddb3 type_label {
        type_unit {
            DW_AT_language @DW_LANG_C
        } {
            declare_labels int_type
 
-           structure_type {
+           type_label: structure_type {
                DW_AT_name struct_with_int_member
                DW_AT_byte_size 4 sdata
            } {