]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Improve dwarf assembly for implicit const in .debug_names
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)
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 */
...

Approved-By: Tom Tromey <tom@tromey.com>
gdb/testsuite/lib/dwarf.exp

index 5358dc317a18a37e1a397cdc3e89150cc51b965b..9575f4b0b1c8cfb622a945d86c1d8ea2380ac598 100644 (file)
@@ -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"
                }