aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2025-03-14 00:32:51 -0400
committerSimon Marchi <simon.marchi@efficios.com>2025-03-14 12:23:40 -0400
commit12e442efecc4f37d632c265cafee8594a794ad12 (patch)
treeed87be1a0be363e064be4d5a3bac59a221e28463
parent4509b5a909104b2aff2230fb26bf245267afc0a6 (diff)
downloadbinutils-12e442efecc4f37d632c265cafee8594a794ad12.zip
binutils-12e442efecc4f37d632c265cafee8594a794ad12.tar.gz
binutils-12e442efecc4f37d632c265cafee8594a794ad12.tar.bz2
gdb/dwarf: remove unnecessary per_objfile parameter in cooked_indexer::ensure_cu_exists
The per_objfile object can be obtained from the cutu_reader. This is actually how both callers get it in order to pass it as argument. Change-Id: Iac134ded247d841f80ab5ca55dd9055b556410c3 Approved-By: Tom Tromey <tom@tromey.com>
-rw-r--r--gdb/dwarf2/cooked-indexer.c8
-rw-r--r--gdb/dwarf2/cooked-indexer.h1
2 files changed, 3 insertions, 6 deletions
diff --git a/gdb/dwarf2/cooked-indexer.c b/gdb/dwarf2/cooked-indexer.c
index 18c9c3b..441a852 100644
--- a/gdb/dwarf2/cooked-indexer.c
+++ b/gdb/dwarf2/cooked-indexer.c
@@ -83,7 +83,6 @@ tag_can_have_linkage_name (enum dwarf_tag tag)
cutu_reader *
cooked_indexer::ensure_cu_exists (cutu_reader *reader,
- dwarf2_per_objfile *per_objfile,
sect_offset sect_off, bool is_dwz,
bool for_scanning)
{
@@ -93,6 +92,7 @@ cooked_indexer::ensure_cu_exists (cutu_reader *reader,
&& reader->cu ()->header.offset_in_cu_p (sect_off))
return reader;
+ dwarf2_per_objfile *per_objfile = reader->cu ()->per_objfile;
dwarf2_per_cu *per_cu
= dwarf2_find_containing_comp_unit (sect_off, is_dwz,
per_objfile->per_bfd);
@@ -311,8 +311,7 @@ cooked_indexer::scan_attributes (dwarf2_per_cu *scanning_per_cu,
&& origin_offset != sect_offset (0))
{
cutu_reader *new_reader
- = ensure_cu_exists (reader, reader->cu ()->per_objfile, origin_offset,
- origin_is_dwz, false);
+ = ensure_cu_exists (reader, origin_offset, origin_is_dwz, false);
if (new_reader == nullptr)
error (_(DWARF_ERROR_PREFIX
"cannot follow reference to DIE at %s"
@@ -430,9 +429,8 @@ cooked_indexer::index_imported_unit (cutu_reader *reader,
if (sect_off == sect_offset (0))
return info_ptr;
- dwarf2_per_objfile *per_objfile = reader->cu ()->per_objfile;
cutu_reader *new_reader
- = ensure_cu_exists (reader, per_objfile, sect_off, is_dwz, true);
+ = ensure_cu_exists (reader, sect_off, is_dwz, true);
if (new_reader != nullptr)
{
index_dies (new_reader, new_reader->info_ptr (), nullptr, false);
diff --git a/gdb/dwarf2/cooked-indexer.h b/gdb/dwarf2/cooked-indexer.h
index a33f5d1..93626a9 100644
--- a/gdb/dwarf2/cooked-indexer.h
+++ b/gdb/dwarf2/cooked-indexer.h
@@ -55,7 +55,6 @@ private:
the DIEs in the CU; when false, this use is assumed to be to look
up just a single DIE. */
cutu_reader *ensure_cu_exists (cutu_reader *reader,
- dwarf2_per_objfile *per_objfile,
sect_offset sect_off,
bool is_dwz,
bool for_scanning);