public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Add dwarf2_per_cu_data::addresses_seen
Date: Tue, 12 Apr 2022 15:39:25 +0000 (GMT)	[thread overview]
Message-ID: <20220412153925.7EE043858D28@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cffae852e33b3c735cc48a398a15e7236bc39928

commit cffae852e33b3c735cc48a398a15e7236bc39928
Author: Tom Tromey <tom@tromey.com>
Date:   Fri Jun 11 13:23:28 2021 -0600

    Add dwarf2_per_cu_data::addresses_seen
    
    This adds a new member to dwarf2_per_cu_data that indicates whether
    addresses have been seen for this CU.  This is then set by the
    .debug_aranges reader.  The idea here is to detect when a CU does not
    have address information, so that the new indexer will know to do
    extra scanning in that case.

Diff:
---
 gdb/dwarf2/read.c | 2 ++
 gdb/dwarf2/read.h | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 425244358a7..e0ae7330732 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -2740,6 +2740,8 @@ read_addrmap_from_aranges (dwarf2_per_objfile *per_objfile,
 		 - baseaddr);
 	  addrmap_set_empty (mutable_map, start, end - 1, per_cu);
 	}
+
+      per_cu->addresses_seen = true;
     }
 
   return true;
diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
index effeaabc4af..58f6a673e69 100644
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -104,6 +104,7 @@ struct dwarf2_per_cu_data
       reading_dwo_directly (false),
       tu_read (false),
       m_header_read_in (false),
+      addresses_seen (false),
       unit_type {},
       lang (language_unknown)
   {
@@ -154,6 +155,10 @@ struct dwarf2_per_cu_data
      it private at the moment.  */
   mutable bool m_header_read_in : 1;
 
+  /* If addresses have been read for this CU (usually from
+     .debug_aranges), then this flag is set.  */
+  bool addresses_seen : 1;
+
   /* The unit type of this CU.  */
   ENUM_BITFIELD (dwarf_unit_type) unit_type : 8;


                 reply	other threads:[~2022-04-12 15:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220412153925.7EE043858D28@sourceware.org \
    --to=tromey@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).