Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH][gdb/testsuite] Generate .debug_aranges entry for dummy CU
@ 2021-08-26 11:58 Tom de Vries via Gdb-patches
  2021-08-27 13:42 ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Tom de Vries via Gdb-patches @ 2021-08-26 11:58 UTC (permalink / raw)
  To: gdb-patches

Hi,

A best practise for DWARF [1] is to generate .debug_aranges entries for CUs
even if they have no address range.

Generate .debug_arange entries for the dummy CUs added by the DWARF assembler.

Tested on x86_64-linux.

[1] http://wiki.dwarfstd.org/index.php?title=Best_Practices

Any comments?

Thanks,
- Tom

[gdb/testsuite] Generate .debug_aranges entry for dummy CU

---
 gdb/testsuite/lib/dwarf.exp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index 32b110b3f3e..02cb4db729c 100644
--- a/gdb/testsuite/lib/dwarf.exp
+++ b/gdb/testsuite/lib/dwarf.exp
@@ -2436,8 +2436,14 @@ namespace eval Dwarf {
 
     # Emit a dummy CU.
     proc dummy_cu {} {
+	declare_labels dummy_cu
+
 	# Generate a CU with default options and empty body.
-	cu {} {
+	cu {label dummy_cu} {
+	}
+
+	# Generate an .debug_aranges entry for the dummy CU.
+	aranges {} dummy_cu {
 	}
     }
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-27 16:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-26 11:58 [PATCH][gdb/testsuite] Generate .debug_aranges entry for dummy CU Tom de Vries via Gdb-patches
2021-08-27 13:42 ` Tom Tromey
2021-08-27 14:52   ` Tom de Vries via Gdb-patches
2021-08-27 16:40     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox