Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [PATCH][gdb/testsuite] Generate .debug_aranges entry for dummy CU
Date: Thu, 26 Aug 2021 13:58:17 +0200	[thread overview]
Message-ID: <20210826115816.GA22826@delia> (raw)

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 {
 	}
     }
 

             reply	other threads:[~2021-08-26 11:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 11:58 Tom de Vries via Gdb-patches [this message]
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

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=20210826115816.GA22826@delia \
    --to=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /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