public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Remove more calls to dwarf2_per_objfile::adjust
@ 2024-05-04 16:07 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2024-05-04 16:07 UTC (permalink / raw)
  To: gdb-cvs

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

commit a5a401018905185d6b82395b2c40a15dcb229bc6
Author: Tom Tromey <tom@tromey.com>
Date:   Fri Mar 8 13:37:50 2024 -0700

    Remove more calls to dwarf2_per_objfile::adjust
    
    As with the previous patch, this patch removes some calls to
    dwarf2_per_objfile::adjust.  These calls are not needed by the cooked
    indexer, as it does not create symbols or look up symbols by address.
    
    The call in dwarf2_ranges_read is similarly not needed, as it is only
    used to update an addrmap; and in any case I believe this particular
    call is only reached by the indexer.

Diff:
---
 gdb/dwarf2/read.c | 26 ++++++++------------------
 1 file changed, 8 insertions(+), 18 deletions(-)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 00e8608f9ce..76330d7b784 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -10919,7 +10919,6 @@ dwarf2_ranges_read (unsigned offset, unrelocated_addr *low_return,
 		    unrelocated_addr *high_return, struct dwarf2_cu *cu,
 		    addrmap_mutable *map, void *datum, dwarf_tag tag)
 {
-  dwarf2_per_objfile *per_objfile = cu->per_objfile;
   int low_set = 0;
   unrelocated_addr low = {};
   unrelocated_addr high = {};
@@ -10930,13 +10929,10 @@ dwarf2_ranges_read (unsigned offset, unrelocated_addr *low_return,
     {
       if (map != nullptr)
 	{
-	  unrelocated_addr lowpc;
-	  unrelocated_addr highpc;
-
-	  lowpc = per_objfile->adjust (range_beginning);
-	  highpc = per_objfile->adjust (range_end);
 	  /* addrmap only accepts CORE_ADDR, so we must cast here.  */
-	  map->set_empty ((CORE_ADDR) lowpc, (CORE_ADDR) highpc - 1, datum);
+	  map->set_empty ((CORE_ADDR) range_beginning,
+			  (CORE_ADDR) range_end - 1,
+			  datum);
 	}
 
       /* FIXME: This is recording everything as a low-high
@@ -15996,14 +15992,11 @@ cooked_indexer::check_bounds (cutu_reader *reader)
 			    cu, m_index_storage->get_addrmap (), cu->per_cu);
   if (cu_bounds_kind == PC_BOUNDS_HIGH_LOW && best_lowpc < best_highpc)
     {
-      dwarf2_per_objfile *per_objfile = cu->per_objfile;
-      unrelocated_addr low = per_objfile->adjust (best_lowpc);
-      unrelocated_addr high = per_objfile->adjust (best_highpc);
       /* Store the contiguous range if it is not empty; it can be
 	 empty for CUs with no code.  addrmap requires CORE_ADDR, so
 	 we cast here.  */
-      m_index_storage->get_addrmap ()->set_empty ((CORE_ADDR) low,
-						  (CORE_ADDR) high - 1,
+      m_index_storage->get_addrmap ()->set_empty ((CORE_ADDR) best_lowpc,
+						  (CORE_ADDR) best_highpc - 1,
 						  cu->per_cu);
 
       cu->per_cu->addresses_seen = true;
@@ -16309,13 +16302,10 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu,
 
 	  if (*high_pc > *low_pc)
 	    {
-	      dwarf2_per_objfile *per_objfile = reader->cu->per_objfile;
-	      unrelocated_addr lo = per_objfile->adjust (*low_pc);
-	      unrelocated_addr hi = per_objfile->adjust (*high_pc);
 	      /* Need CORE_ADDR casts for addrmap.  */
-	      m_index_storage->get_addrmap ()->set_empty ((CORE_ADDR) lo,
-							  (CORE_ADDR) hi - 1,
-							  scanning_per_cu);
+	      m_index_storage->get_addrmap ()->set_empty
+		((CORE_ADDR) *low_pc, (CORE_ADDR) *high_pc - 1,
+		 scanning_per_cu);
 	    }
 	}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-04 16:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-04 16:07 [binutils-gdb] Remove more calls to dwarf2_per_objfile::adjust Tom Tromey

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).