aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2025-03-05 16:10:08 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2025-03-06 11:39:00 -0500
commitb8c80caf59ff114fc717457f0ba9ddcd539c52eb (patch)
tree4957113de882a97e14f262dcf4ab45b610ee4410
parent54333345d29d85d61bd7a00e9e557d857795122f (diff)
downloadbinutils-b8c80caf59ff114fc717457f0ba9ddcd539c52eb.zip
binutils-b8c80caf59ff114fc717457f0ba9ddcd539c52eb.tar.gz
binutils-b8c80caf59ff114fc717457f0ba9ddcd539c52eb.tar.bz2
gdb/dwarf: pass dwarf2_cu instead of cutu_reader to two functions
These functions don't need to receive a cutu_reader, they only use it to obtain the contained dwarf2_cu, so change them to accept a dwarf2_cu. This helps reduce the creep of cutu_reader a little bit. Change-Id: Iebb3c4697a4aec638b47423b3ac59077d4fa5090 Approved-By: Tom Tromey <tom@tromey.com>
-rw-r--r--gdb/dwarf2/read.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 6740597..56cadde 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -1922,10 +1922,8 @@ dwarf2_per_bfd::allocate_signatured_type (dwarf2_section_info *section,
/* die_reader_func for dw2_get_file_names. */
static void
-dw2_get_file_names_reader (const cutu_reader *reader,
- struct die_info *comp_unit_die)
+dw2_get_file_names_reader (dwarf2_cu *cu, die_info *comp_unit_die)
{
- struct dwarf2_cu *cu = reader->cu;
dwarf2_per_cu *this_cu = cu->per_cu;
dwarf2_per_objfile *per_objfile = cu->per_objfile;
struct attribute *attr;
@@ -2029,7 +2027,7 @@ dw2_get_file_names (dwarf2_per_cu *this_cu, dwarf2_per_objfile *per_objfile)
cutu_reader reader (this_cu, per_objfile, language_minimal);
if (!reader.dummy_p)
- dw2_get_file_names_reader (&reader, reader.comp_unit_die);
+ dw2_get_file_names_reader (reader.cu, reader.comp_unit_die);
return this_cu->file_names;
}
@@ -6835,11 +6833,10 @@ lookup_dwo_file (dwarf2_per_bfd *per_bfd, const char *dwo_name,
/* die_reader_func for create_dwo_cu. */
static void
-create_dwo_cu_reader (const cutu_reader *reader, const gdb_byte *info_ptr,
+create_dwo_cu_reader (dwarf2_cu *cu, const gdb_byte *info_ptr,
die_info *comp_unit_die, dwo_file *dwo_file,
dwo_unit *dwo_unit)
{
- struct dwarf2_cu *cu = reader->cu;
sect_offset sect_off = cu->per_cu->sect_off;
struct dwarf2_section_info *section = cu->per_cu->section;
@@ -6899,7 +6896,7 @@ create_cus_hash_table (dwarf2_cu *cu, dwo_file &dwo_file)
cu, &dwo_file);
if (!reader.dummy_p)
- create_dwo_cu_reader (&reader, reader.info_ptr, reader.comp_unit_die,
+ create_dwo_cu_reader (reader.cu, reader.info_ptr, reader.comp_unit_die,
&dwo_file, &read_unit);
info_ptr += per_cu.length ();