* [PATCH 0/4] [gdb/testsuite] Fix some more dwarf assembly test-cases
@ 2026-05-22 14:37 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
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Tom de Vries @ 2026-05-22 14:37 UTC (permalink / raw)
To: gdb-patches
Three more patches fixing warnings with readelf -w or llvm-dwarfdump -a in
dwarf assembly test-cases.
In the process, I found a problem in readelf, fixed by commit 1678d7d3d2e
("[binutils] Handle implicit const in .debug_names").
The last patch doesn't fix a warning, but fixes comments related to implicit
const in generated dwarf assembly.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34157
Tom de Vries (4):
[gdb/testsuite] Remove invalid .debug_line section in
gdb.dwarf2/dw2-icycle.exp
[gdb/testsuite] Complete 64-bit port of
gdb.dwarf2/dw2-skip-prologue.exp
[gdb/testsuite] Add missing type_offset in
gdb.dwarf/debug-names-tu.exp
[gdb/testsuite] Improve dwarf assembly for implicit const in
.debug_names
.../gdb.dwarf2/debug-names-bad-cu-index.exp | 6 ++--
.../gdb.dwarf2/debug-names-tu.exp.tcl | 6 ++--
gdb/testsuite/gdb.dwarf2/dw2-const.S | 18 +++++++++---
gdb/testsuite/gdb.dwarf2/dw2-const.exp | 12 +++++++-
gdb/testsuite/gdb.dwarf2/dw2-icycle.S | 4 ---
gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S | 28 ++++++++++---------
gdb/testsuite/lib/dwarf.exp | 5 ++--
7 files changed, 51 insertions(+), 28 deletions(-)
base-commit: 1678d7d3d2e4cf83cda5a96334a0326573ad0f7c
--
2.51.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/4] [gdb/testsuite] Remove invalid .debug_line section in gdb.dwarf2/dw2-icycle.exp
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 ` 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
` (2 subsequent siblings)
3 siblings, 1 reply; 10+ messages in thread
From: Tom de Vries @ 2026-05-22 14:37 UTC (permalink / raw)
To: gdb-patches
Test-case source gdb.dwarf2/dw2-icycle.S contains an invalid .debug_line
section contribution, causing a readelf -w warning.
It's also unused, so fix the warning by removing it.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34157
---
gdb/testsuite/gdb.dwarf2/dw2-icycle.S | 4 ----
1 file changed, 4 deletions(-)
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-icycle.S b/gdb/testsuite/gdb.dwarf2/dw2-icycle.S
index 3e79c966aef..4bd67a4cb7d 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-icycle.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-icycle.S
@@ -250,10 +250,6 @@ p__top:
.byte 0
.byte 0
- .section .debug_line
-.Lline1_begin:
- .byte 0
-
#ifdef __arm__
.section .note.GNU-stack,"",%progbits
#else
--
2.51.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/4] [gdb/testsuite] Complete 64-bit port of gdb.dwarf2/dw2-skip-prologue.exp
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:37 ` 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 14:37 ` [PATCH 4/4] [gdb/testsuite] Improve dwarf assembly for implicit const in .debug_names Tom de Vries
3 siblings, 1 reply; 10+ messages in thread
From: Tom de Vries @ 2026-05-22 14:37 UTC (permalink / raw)
To: gdb-patches
Test-source gdb.dwarf2/dw2-skip-prologue.S was generated using 32-bit, and
subsequently ported to 64-bit using macro PTRBYTE.
When using 64-bit, there are some readelf -w warnings because the port to
64-bit is not complete. Fix these warnings.
Likewise in gdb.dwarf/dw2-const.exp.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34157
---
gdb/testsuite/gdb.dwarf2/dw2-const.S | 18 ++++++++++---
gdb/testsuite/gdb.dwarf2/dw2-const.exp | 12 ++++++++-
gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S | 28 +++++++++++---------
3 files changed, 40 insertions(+), 18 deletions(-)
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-const.S b/gdb/testsuite/gdb.dwarf2/dw2-const.S
index 94cf1acbed6..1161633f181 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-const.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-const.S
@@ -15,6 +15,16 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#if PTRBITS == 64
+# define PTRBYTE .8byte
+# define PTRBYTES 8
+#elif PTRBITS == 32
+# define PTRBYTE .4byte
+# define PTRBYTES 4
+#else
+# error "Unsupported pointer size"
+#endif
+
/* Dummy function to provide debug information for. */
.text
@@ -228,9 +238,9 @@ func_cu1:
.Lline1_lines:
.byte 0 /* DW_LNE_set_address */
- .uleb128 5
+ .uleb128 1 + PTRBYTES
.byte 2
- .4byte .Lbegin_func_cu1
+ PTRBYTE .Lbegin_func_cu1
.byte 3 /* DW_LNS_advance_line */
.sleb128 3 /* ... to 4 */
@@ -240,9 +250,9 @@ func_cu1:
.byte 1 /* DW_LNS_copy (second time as an end-of-prologue marker) */
.byte 0 /* DW_LNE_set_address */
- .uleb128 5
+ .uleb128 1 + PTRBYTES
.byte 2
- .4byte .Lend_func_cu1
+ PTRBYTE .Lend_func_cu1
.byte 0 /* DW_LNE_end_of_sequence */
.uleb128 1
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-const.exp b/gdb/testsuite/gdb.dwarf2/dw2-const.exp
index 93ddfaa0f2f..f855659f8bd 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-const.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-const.exp
@@ -19,8 +19,18 @@ require dwarf2_support
standard_testfile .S
+if {[is_ilp32_target]} {
+ set ptrbits 32
+} else {
+ set ptrbits 64
+}
+
+set srcfile_opts {}
+lappend srcfile_opts nodebug
+lappend srcfile_opts additional_flags=-DPTRBITS=$ptrbits
+
if {[prepare_for_testing_full "failed to prepare" \
- [list $testfile debug main.c debug $srcfile nodebug]]} {
+ [list $testfile debug main.c debug $srcfile $srcfile_opts]]} {
return
}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S b/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S
index 19165a513a4..11d794bc412 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S
@@ -17,8 +17,10 @@
#if PTRBITS == 64
# define PTRBYTE .8byte
+# define PTRBYTES 8
#elif PTRBITS == 32
# define PTRBYTE .4byte
+# define PTRBYTES 4
#else
# error "Unsupported pointer size"
#endif
@@ -130,7 +132,7 @@ loclist:
1: .byte 0x50 /* DW_OP_reg0 */
2:
/* Location list end. */
- .4byte 0, 0
+ PTRBYTE 0, 0
/* Abbrev table */
.section .debug_abbrev
@@ -283,7 +285,7 @@ loclist:
.Lline1_lines:
.byte 0 /* DW_LNE_set_address */
- .uleb128 5
+ .uleb128 1 + PTRBYTES
.byte 2
PTRBYTE func_start
.byte 3 /* DW_LNS_advance_line */
@@ -291,7 +293,7 @@ loclist:
.byte 1 /* DW_LNS_copy */
.byte 0 /* DW_LNE_set_address */
- .uleb128 5
+ .uleb128 1 + PTRBYTES
.byte 2
PTRBYTE func0
.byte 4 /* DW_LNS_set_file */
@@ -301,7 +303,7 @@ loclist:
.byte 1 /* DW_LNS_copy */
.byte 0 /* DW_LNE_set_address */
- .uleb128 5
+ .uleb128 1 + PTRBYTES
.byte 2
PTRBYTE func1
.byte 4 /* DW_LNS_set_file */
@@ -311,7 +313,7 @@ loclist:
.byte 1 /* DW_LNS_copy */
.byte 0 /* DW_LNE_set_address */
- .uleb128 5
+ .uleb128 1 + PTRBYTES
.byte 2
PTRBYTE func2
.byte 4 /* DW_LNS_set_file */
@@ -321,7 +323,7 @@ loclist:
.byte 1 /* DW_LNS_copy */
.byte 0 /* DW_LNE_set_address */
- .uleb128 5
+ .uleb128 1 + PTRBYTES
.byte 2
PTRBYTE func3
.byte 4 /* DW_LNS_set_file */
@@ -331,14 +333,14 @@ loclist:
.byte 1 /* DW_LNS_copy */
.byte 0 /* DW_LNE_set_address */
- .uleb128 5
+ .uleb128 1 + PTRBYTES
.byte 2
PTRBYTE func_end
/* Equivalent copy but renamed s/func/fund/. */
.byte 0 /* DW_LNE_set_address */
- .uleb128 5
+ .uleb128 1 + PTRBYTES
.byte 2
PTRBYTE fund_start
.byte 3 /* DW_LNS_advance_line */
@@ -346,7 +348,7 @@ loclist:
.byte 1 /* DW_LNS_copy */
.byte 0 /* DW_LNE_set_address */
- .uleb128 5
+ .uleb128 1 + PTRBYTES
.byte 2
PTRBYTE fund0
.byte 4 /* DW_LNS_set_file */
@@ -356,7 +358,7 @@ loclist:
.byte 1 /* DW_LNS_copy */
.byte 0 /* DW_LNE_set_address */
- .uleb128 5
+ .uleb128 1 + PTRBYTES
.byte 2
PTRBYTE fund1
.byte 4 /* DW_LNS_set_file */
@@ -366,7 +368,7 @@ loclist:
.byte 1 /* DW_LNS_copy */
.byte 0 /* DW_LNE_set_address */
- .uleb128 5
+ .uleb128 1 + PTRBYTES
.byte 2
PTRBYTE fund2
.byte 4 /* DW_LNS_set_file */
@@ -376,7 +378,7 @@ loclist:
.byte 1 /* DW_LNS_copy */
.byte 0 /* DW_LNE_set_address */
- .uleb128 5
+ .uleb128 1 + PTRBYTES
.byte 2
PTRBYTE fund3
.byte 4 /* DW_LNS_set_file */
@@ -386,7 +388,7 @@ loclist:
.byte 1 /* DW_LNS_copy */
.byte 0 /* DW_LNE_set_address */
- .uleb128 5
+ .uleb128 1 + PTRBYTES
.byte 2
PTRBYTE fund_end
--
2.51.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/4] [gdb/testsuite] Add missing type_offset in gdb.dwarf/debug-names-tu.exp
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:37 ` [PATCH 2/4] [gdb/testsuite] Complete 64-bit port of gdb.dwarf2/dw2-skip-prologue.exp Tom de Vries
@ 2026-05-22 14:37 ` Tom de Vries
2026-05-22 15:03 ` Tom Tromey
2026-05-22 14:37 ` [PATCH 4/4] [gdb/testsuite] Improve dwarf assembly for implicit const in .debug_names Tom de Vries
3 siblings, 1 reply; 10+ messages in thread
From: Tom de Vries @ 2026-05-22 14:37 UTC (permalink / raw)
To: gdb-patches
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.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34157
---
gdb/testsuite/gdb.dwarf2/debug-names-bad-cu-index.exp | 6 ++++--
gdb/testsuite/gdb.dwarf2/debug-names-tu.exp.tcl | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/gdb/testsuite/gdb.dwarf2/debug-names-bad-cu-index.exp b/gdb/testsuite/gdb.dwarf2/debug-names-bad-cu-index.exp
index 10e649f06af..5d31414ba29 100644
--- a/gdb/testsuite/gdb.dwarf2/debug-names-bad-cu-index.exp
+++ b/gdb/testsuite/gdb.dwarf2/debug-names-bad-cu-index.exp
@@ -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
} {
diff --git a/gdb/testsuite/gdb.dwarf2/debug-names-tu.exp.tcl b/gdb/testsuite/gdb.dwarf2/debug-names-tu.exp.tcl
index af3f263a273..bd48df6a894 100644
--- a/gdb/testsuite/gdb.dwarf2/debug-names-tu.exp.tcl
+++ b/gdb/testsuite/gdb.dwarf2/debug-names-tu.exp.tcl
@@ -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
} {
--
2.51.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 4/4] [gdb/testsuite] Improve dwarf assembly for implicit const in .debug_names
2026-05-22 14:37 [PATCH 0/4] [gdb/testsuite] Fix some more dwarf assembly test-cases Tom de Vries
` (2 preceding siblings ...)
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 14:37 ` Tom de Vries
2026-05-22 14:54 ` Tom Tromey
3 siblings, 1 reply; 10+ messages in thread
From: Tom de Vries @ 2026-05-22 14:37 UTC (permalink / raw)
To: gdb-patches
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 4/4] [gdb/testsuite] Improve dwarf assembly for implicit const in .debug_names
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
0 siblings, 0 replies; 10+ messages in thread
From: Tom Tromey @ 2026-05-22 14:54 UTC (permalink / raw)
To: Tom de Vries; +Cc: gdb-patches
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
Tom> Fix the comment, and make the relation between the two entries more clear by
Tom> printing:
Tom> ...
Tom> .uleb128 0x2003 /* DW_IDX_GNU_language */
Tom> .uleb128 0x21 /* DW_FORM_implicit_const */
Tom> .sleb128 0x0002 /* DW_FORM_implicit_const value: DW_LANG_C */
Thank you.
Approved-By: Tom Tromey <tom@tromey.com>
Tom
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] [gdb/testsuite] Remove invalid .debug_line section in gdb.dwarf2/dw2-icycle.exp
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
0 siblings, 0 replies; 10+ messages in thread
From: Tom Tromey @ 2026-05-22 14:55 UTC (permalink / raw)
To: Tom de Vries; +Cc: gdb-patches
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
Tom> Test-case source gdb.dwarf2/dw2-icycle.S contains an invalid .debug_line
Tom> section contribution, causing a readelf -w warning.
Tom> It's also unused, so fix the warning by removing it.
Looks good.
Approved-By: Tom Tromey <tom@tromey.com>
Tom
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/4] [gdb/testsuite] Add missing type_offset in gdb.dwarf/debug-names-tu.exp
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
0 siblings, 1 reply; 10+ messages in thread
From: Tom Tromey @ 2026-05-22 15:03 UTC (permalink / raw)
To: Tom de Vries; +Cc: gdb-patches
>>>>> "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?
Approved-By: Tom Tromey <tom@tromey.com>
Tom
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/4] [gdb/testsuite] Complete 64-bit port of gdb.dwarf2/dw2-skip-prologue.exp
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
0 siblings, 0 replies; 10+ messages in thread
From: Tom Tromey @ 2026-05-22 15:07 UTC (permalink / raw)
To: Tom de Vries; +Cc: gdb-patches
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
Tom> Test-source gdb.dwarf2/dw2-skip-prologue.S was generated using 32-bit, and
Tom> subsequently ported to 64-bit using macro PTRBYTE.
Tom> When using 64-bit, there are some readelf -w warnings because the port to
Tom> 64-bit is not complete. Fix these warnings.
Tom> Likewise in gdb.dwarf/dw2-const.exp.
This looks good.
Approved-By: Tom Tromey <tom@tromey.com>
I may try converting dw2-const.exp to the DWARF assembler.
dw2-skip-prologue sounds harder, based on the name at least.
Tom
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/4] [gdb/testsuite] Add missing type_offset in gdb.dwarf/debug-names-tu.exp
2026-05-22 15:03 ` Tom Tromey
@ 2026-05-23 8:15 ` Tom de Vries
0 siblings, 0 replies; 10+ messages in thread
From: Tom de Vries @ 2026-05-23 8:15 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
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
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-05-23 8:16 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 4/4] [gdb/testsuite] Improve dwarf assembly for implicit const in .debug_names Tom de Vries
2026-05-22 14:54 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox