Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 4/4] [gdb/testsuite] Improve dwarf assembly for implicit const in .debug_names
Date: Fri, 22 May 2026 16:37:37 +0200	[thread overview]
Message-ID: <20260522143737.3373000-5-tdevries@suse.de> (raw)
In-Reply-To: <20260522143737.3373000-1-tdevries@suse.de>

In the assembly generated for the dwarf assembly for test-case
gdb.dwarf2/debug-names-tu-dwarf5.exp, there's this bit:
...
.uleb128        0x2003          /* DW_IDX_GNU_language */
.uleb128        0x21            /* DW_FORM_flag_present */
.sleb128        0x0002          /* DW_LANG_C */
...

As it happens, 0x21 is not DW_FORM_flag_present, but DW_FORM_implicit_const,
and the following entry is the value of the attribute.

Fix the comment, and make the relation between the two entries more clear by
printing:
...
.uleb128        0x2003          /* DW_IDX_GNU_language */
.uleb128        0x21            /* DW_FORM_implicit_const */
.sleb128        0x0002          /* DW_FORM_implicit_const value: DW_LANG_C */
...
---
 gdb/testsuite/lib/dwarf.exp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index 5358dc317a1..9575f4b0b1c 100644
--- a/gdb/testsuite/lib/dwarf.exp
+++ b/gdb/testsuite/lib/dwarf.exp
@@ -3636,8 +3636,9 @@ namespace eval Dwarf {
 		    _op .uleb128 $_constants(DW_IDX_GNU_language) \
 			"DW_IDX_GNU_language"
 		    _op .uleb128 $_constants(DW_FORM_implicit_const) \
-			"DW_FORM_flag_present"
-		    _op .sleb128 $_constants($word) $word
+			"DW_FORM_implicit_const"
+		    _op .sleb128 $_constants($word) \
+			"DW_FORM_implicit_const value: $word"
 		} else {
 		    error "unrecognized extra keyword $word"
 		}
-- 
2.51.0


  parent reply	other threads:[~2026-05-22 14:38 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
2026-05-22 14:37 ` Tom de Vries [this message]
2026-05-22 14:54   ` [PATCH 4/4] [gdb/testsuite] Improve dwarf assembly for implicit const in .debug_names 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=20260522143737.3373000-5-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /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