* [PATCH 0/3] [gdb/testsuite] Fix some dwarf assembly test-cases
@ 2026-05-20 15:38 Tom de Vries
2026-05-20 15:38 ` [PATCH 1/3] [gdb/testsuite] Clean up gdb.dwarf2/imported-unit-c.exp Tom de Vries
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Tom de Vries @ 2026-05-20 15:38 UTC (permalink / raw)
To: gdb-patches
I ran readelf -w on the executable from test-case
gdb.dwarf2/imported-unit-c.exp, and saw some warnings.
This patch series fixes those, and a few more warnings in other test-cases
that I found using readelf -w and llvm-dwarfdump -a.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34157
Tom de Vries (3):
[gdb/testsuite] Clean up gdb.dwarf2/imported-unit-c.exp
[gdb/testsuite] Clean up duplicate .debug_aranges terminators
[gdb/testsuite] Don't generate dummy CUs in dwz files
gdb/testsuite/gdb.dwarf2/dwzbuildid.tcl | 4 +-
gdb/testsuite/gdb.dwarf2/imported-unit-c.exp | 40 -------------------
gdb/testsuite/gdb.dwarf2/short-build-id.exp | 1 -
.../gdb.dwarf2/struct-with-sig-2.exp | 2 +-
4 files changed, 2 insertions(+), 45 deletions(-)
base-commit: 8822682db0b86fcbf16b41397424cd78d48c924d
--
2.51.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] [gdb/testsuite] Clean up gdb.dwarf2/imported-unit-c.exp
2026-05-20 15:38 [PATCH 0/3] [gdb/testsuite] Fix some dwarf assembly test-cases Tom de Vries
@ 2026-05-20 15:38 ` Tom de Vries
2026-05-20 15:38 ` [PATCH 2/3] [gdb/testsuite] Clean up duplicate .debug_aranges terminators Tom de Vries
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Tom de Vries @ 2026-05-20 15:38 UTC (permalink / raw)
To: gdb-patches
In test-case gdb.dwarf2/imported-unit-c.exp there's some dwarf assembly that's
unused, and is causing readelf -w warnings. Remove it.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34157
---
gdb/testsuite/gdb.dwarf2/imported-unit-c.exp | 40 --------------------
1 file changed, 40 deletions(-)
diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit-c.exp b/gdb/testsuite/gdb.dwarf2/imported-unit-c.exp
index 82f4baf5bdc..c81b489878c 100644
--- a/gdb/testsuite/gdb.dwarf2/imported-unit-c.exp
+++ b/gdb/testsuite/gdb.dwarf2/imported-unit-c.exp
@@ -35,26 +35,6 @@ Dwarf::assemble $asm_file {
DW_AT_name inty
DW_AT_type :$int_label
}
- DW_TAG_typedef {
- DW_AT_name inty_1
- DW_AT_type :$int2_label
- }
- DW_TAG_typedef {
- DW_AT_name inty_2
- DW_AT_type :$int2_label
- }
- DW_TAG_typedef {
- DW_AT_name inty_3
- DW_AT_type :$int2_label
- }
- DW_TAG_typedef {
- DW_AT_name inty_4
- DW_AT_type :$int2_label
- }
- DW_TAG_typedef {
- DW_AT_name inty_5
- DW_AT_type :$int2_label
- }
}
}
@@ -73,26 +53,6 @@ Dwarf::assemble $asm_file {
DW_AT_name inty
DW_AT_type :$int2_label
}
- DW_TAG_typedef {
- DW_AT_name inty_1
- DW_AT_type :$int2_label
- }
- DW_TAG_typedef {
- DW_AT_name inty_2
- DW_AT_type :$int2_label
- }
- DW_TAG_typedef {
- DW_AT_name inty_3
- DW_AT_type :$int2_label
- }
- DW_TAG_typedef {
- DW_AT_name inty_4
- DW_AT_type :$int2_label
- }
- DW_TAG_typedef {
- DW_AT_name inty_5
- DW_AT_type :$int2_label
- }
}
}
--
2.51.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/3] [gdb/testsuite] Clean up duplicate .debug_aranges terminators
2026-05-20 15:38 [PATCH 0/3] [gdb/testsuite] Fix some dwarf assembly test-cases Tom de Vries
2026-05-20 15:38 ` [PATCH 1/3] [gdb/testsuite] Clean up gdb.dwarf2/imported-unit-c.exp Tom de Vries
@ 2026-05-20 15:38 ` Tom de Vries
2026-05-20 15:38 ` [PATCH 3/3] [gdb/testsuite] Don't generate dummy CUs in dwz files Tom de Vries
2026-05-21 14:07 ` [PATCH 0/3] [gdb/testsuite] Fix some dwarf assembly test-cases Tom Tromey
3 siblings, 0 replies; 5+ messages in thread
From: Tom de Vries @ 2026-05-20 15:38 UTC (permalink / raw)
To: gdb-patches
I came across duplicate .debug_aranges terminators:
...
aranges {} cu_start {
arange {} 0 0
}
...
The dwarf assembler already generates a terminator, so there's no need to
generate another one.
Remove these.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34157
---
gdb/testsuite/gdb.dwarf2/dwzbuildid.tcl | 2 --
gdb/testsuite/gdb.dwarf2/short-build-id.exp | 1 -
2 files changed, 3 deletions(-)
diff --git a/gdb/testsuite/gdb.dwarf2/dwzbuildid.tcl b/gdb/testsuite/gdb.dwarf2/dwzbuildid.tcl
index feb95f58feb..45a80bd7ce4 100644
--- a/gdb/testsuite/gdb.dwarf2/dwzbuildid.tcl
+++ b/gdb/testsuite/gdb.dwarf2/dwzbuildid.tcl
@@ -57,7 +57,6 @@ proc write_just_debugaltlink {filename dwzname buildid} {
}
}
aranges {} cu_start {
- arange {} 0 0
}
}
}
@@ -97,7 +96,6 @@ proc write_dwarf_file {filename buildid {value 99}} {
}
aranges {} cu_start {
- arange {} 0 0
}
}
}
diff --git a/gdb/testsuite/gdb.dwarf2/short-build-id.exp b/gdb/testsuite/gdb.dwarf2/short-build-id.exp
index c30b82eb54f..d8a2f351f22 100644
--- a/gdb/testsuite/gdb.dwarf2/short-build-id.exp
+++ b/gdb/testsuite/gdb.dwarf2/short-build-id.exp
@@ -68,7 +68,6 @@ proc run_test { buildid } {
}
aranges {} cu_start {
- arange {} 0 0
}
}
--
2.51.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/3] [gdb/testsuite] Don't generate dummy CUs in dwz files
2026-05-20 15:38 [PATCH 0/3] [gdb/testsuite] Fix some dwarf assembly test-cases Tom de Vries
2026-05-20 15:38 ` [PATCH 1/3] [gdb/testsuite] Clean up gdb.dwarf2/imported-unit-c.exp Tom de Vries
2026-05-20 15:38 ` [PATCH 2/3] [gdb/testsuite] Clean up duplicate .debug_aranges terminators Tom de Vries
@ 2026-05-20 15:38 ` Tom de Vries
2026-05-21 14:07 ` [PATCH 0/3] [gdb/testsuite] Fix some dwarf assembly test-cases Tom Tromey
3 siblings, 0 replies; 5+ messages in thread
From: Tom de Vries @ 2026-05-20 15:38 UTC (permalink / raw)
To: gdb-patches
I came across .debug_aranges sections in .dwz files. Fix this by skipping
dummy CU generation in .dwz files.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34157
---
gdb/testsuite/gdb.dwarf2/dwzbuildid.tcl | 2 +-
gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.dwarf2/dwzbuildid.tcl b/gdb/testsuite/gdb.dwarf2/dwzbuildid.tcl
index 45a80bd7ce4..84e0c9f7669 100644
--- a/gdb/testsuite/gdb.dwarf2/dwzbuildid.tcl
+++ b/gdb/testsuite/gdb.dwarf2/dwzbuildid.tcl
@@ -65,7 +65,7 @@ proc write_just_debugaltlink {filename dwzname buildid} {
proc write_dwarf_file {filename buildid {value 99}} {
set asm_file [standard_output_file $filename]
- Dwarf::assemble $asm_file {
+ Dwarf::assemble [list filename $asm_file add_dummy_cus 0] {
declare_labels int_label int_label2
upvar buildid buildid
diff --git a/gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp b/gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp
index 28a2fd7ad58..5c9f27149af 100644
--- a/gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp
+++ b/gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp
@@ -26,7 +26,7 @@ set build_id [string repeat ff 20]
# Make some DWARF for the dwz file.
set asm_file [standard_output_file $srcfile2]
-Dwarf::assemble $asm_file {
+Dwarf::assemble [list filename $asm_file add_dummy_cus 0] {
build_id $::build_id
tu {} 0x0000000000000001 the_type_i {
--
2.51.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] [gdb/testsuite] Fix some dwarf assembly test-cases
2026-05-20 15:38 [PATCH 0/3] [gdb/testsuite] Fix some dwarf assembly test-cases Tom de Vries
` (2 preceding siblings ...)
2026-05-20 15:38 ` [PATCH 3/3] [gdb/testsuite] Don't generate dummy CUs in dwz files Tom de Vries
@ 2026-05-21 14:07 ` Tom Tromey
3 siblings, 0 replies; 5+ messages in thread
From: Tom Tromey @ 2026-05-21 14:07 UTC (permalink / raw)
To: Tom de Vries; +Cc: gdb-patches
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
Tom> I ran readelf -w on the executable from test-case
Tom> gdb.dwarf2/imported-unit-c.exp, and saw some warnings.
Tom> This patch series fixes those, and a few more warnings in other test-cases
Tom> that I found using readelf -w and llvm-dwarfdump -a.
Tom> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34157
These all look good to me, thank you.
Approved-By: Tom Tromey <tom@tromey.com>
Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-05-21 14:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-20 15:38 [PATCH 0/3] [gdb/testsuite] Fix some dwarf assembly test-cases Tom de Vries
2026-05-20 15:38 ` [PATCH 1/3] [gdb/testsuite] Clean up gdb.dwarf2/imported-unit-c.exp Tom de Vries
2026-05-20 15:38 ` [PATCH 2/3] [gdb/testsuite] Clean up duplicate .debug_aranges terminators Tom de Vries
2026-05-20 15:38 ` [PATCH 3/3] [gdb/testsuite] Don't generate dummy CUs in dwz files Tom de Vries
2026-05-21 14:07 ` [PATCH 0/3] [gdb/testsuite] Fix some dwarf assembly test-cases Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox