Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 3/4] [gdb/testsuite] Add missing type_offset in gdb.dwarf/debug-names-tu.exp
Date: Sat, 23 May 2026 10:15:59 +0200	[thread overview]
Message-ID: <a0be9c8d-6ca0-440d-954a-91debbb90a2f@suse.de> (raw)
In-Reply-To: <87se7j7ahe.fsf@tromey.com>

On 5/22/26 5:03 PM, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
> 
> Tom> With llvm-dwarfdump we run into this warning:
> Tom> ...
> Tom> $ llvm-dwarfdump -a -v debug-names-tu > /dev/null
> Tom> warning: DWARF type unit at offset 0x00000028 has its relocated type_offset \
> Tom>   0x00000028 pointing inside the header
> Tom> ...
> 
> Tom> Fix this by adding the missing type_offset.
> 
> Tom> Likewise in gdb.dwarf2/debug-names-bad-cu-index.exp.
> 
> Tom> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34157
> 
> This looks good but I wonder if the type offset should simply be
> mandatory to 'proc tu'?  Like should it reject an empty string and
> require a real label?
> 

I came across fission-type-unit-locexpr.exp, which has:
...
     # Stub for "int" type unit. 

     tu {
         version 4
     } 0xCAFE1 "" {
         type_unit {
             DW_AT_GNU_dwo_name ${::gdb_test_file_name}.dwo DW_FORM_strp
             DW_AT_comp_dir ${outdir}
	} {
         }
     }
...

We could fix this by doing:
...
+    declare_labels none1
      # Stub for "int" type unit.
      tu {
  	version 4
-    } 0xCAFE1 "" {
+    } 0xCAFE1 none1 {
  	type_unit {
  	    DW_AT_GNU_dwo_name ${::gdb_test_file_name}.dwo DW_FORM_strp
  	    DW_AT_comp_dir ${outdir}
  	} {
+	    none1:
  	}
      }
...
and indeed that fixes the warning, but eventually there might be another 
warning complaining about that (points to abbrev number 0 instead of type).

So I left this as is.

Thanks,
- Tom

> Approved-By: Tom Tromey <tom@tromey.com>
> 
> Tom


  reply	other threads:[~2026-05-23  8:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-22 14:37 [PATCH 0/4] [gdb/testsuite] Fix some more dwarf assembly test-cases Tom de Vries
2026-05-22 14:37 ` [PATCH 1/4] [gdb/testsuite] Remove invalid .debug_line section in gdb.dwarf2/dw2-icycle.exp Tom de Vries
2026-05-22 14:55   ` Tom Tromey
2026-05-22 14:37 ` [PATCH 2/4] [gdb/testsuite] Complete 64-bit port of gdb.dwarf2/dw2-skip-prologue.exp Tom de Vries
2026-05-22 15:07   ` Tom Tromey
2026-05-22 14:37 ` [PATCH 3/4] [gdb/testsuite] Add missing type_offset in gdb.dwarf/debug-names-tu.exp Tom de Vries
2026-05-22 15:03   ` Tom Tromey
2026-05-23  8:15     ` Tom de Vries [this message]
2026-05-22 14:37 ` [PATCH 4/4] [gdb/testsuite] Improve dwarf assembly for implicit const in .debug_names Tom de Vries
2026-05-22 14:54   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a0be9c8d-6ca0-440d-954a-91debbb90a2f@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox