From: Simon Marchi Date: Wed, 5 Mar 2025 21:10:08 +0000 (-0500) Subject: gdb/dwarf: pass dwarf2_cu instead of cutu_reader to two functions X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b8c80caf59ff114fc717457f0ba9ddcd539c52eb;p=thirdparty%2Fbinutils-gdb.git 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 --- diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 6740597348c..56caddeb208 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 ();