From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id E528D3858C56; Tue, 12 Apr 2022 15:39:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E528D3858C56 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Refactor build_type_psymtabs_reader X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 4e9e4fcda5e820d770369824669d86d3fadcad04 X-Git-Newrev: c0892a1d5dc29eb849e9aed0fb7c7dade6dffb23 Message-Id: <20220412153955.E528D3858C56@sourceware.org> Date: Tue, 12 Apr 2022 15:39:55 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2022 15:39:56 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dc0892a1d5dc2= 9eb849e9aed0fb7c7dade6dffb23 commit c0892a1d5dc29eb849e9aed0fb7c7dade6dffb23 Author: Tom Tromey Date: Fri Jun 18 15:36:40 2021 -0600 Refactor build_type_psymtabs_reader =20 The new DWARF scanner needs to save the entire cutu_reader object, not just parts of it. In order to make this possible, this patch refactors build_type_psymtabs_reader. This change is done separately because it is easy to review in isolation and it helps make the later patches smaller. Diff: --- gdb/dwarf2/read.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index af9602da1dd..a986d9a2ab2 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -1104,9 +1104,7 @@ static dwarf2_psymtab *create_partial_symtab (dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, const char *name); =20 -static void build_type_psymtabs_reader (const struct die_reader_specs *rea= der, - const gdb_byte *info_ptr, - struct die_info *type_unit_die); +static void build_type_psymtabs_reader (cutu_reader *reader); =20 static void dwarf2_build_psymtabs_hard (dwarf2_per_objfile *per_objfile); =20 @@ -7162,8 +7160,7 @@ process_psymtab_comp_unit (dwarf2_per_cu_data *this_c= u, /* Nothing. */ } else if (this_cu->is_debug_types) - build_type_psymtabs_reader (&reader, reader.info_ptr, - reader.comp_unit_die); + build_type_psymtabs_reader (&reader); else if (want_partial_unit || reader.comp_unit_die->tag !=3D DW_TAG_partial_unit) process_psymtab_comp_unit_reader (&reader, reader.info_ptr, @@ -7177,9 +7174,7 @@ process_psymtab_comp_unit (dwarf2_per_cu_data *this_c= u, /* Reader function for build_type_psymtabs. */ =20 static void -build_type_psymtabs_reader (const struct die_reader_specs *reader, - const gdb_byte *info_ptr, - struct die_info *type_unit_die) +build_type_psymtabs_reader (cutu_reader *reader) { dwarf2_per_objfile *per_objfile =3D reader->cu->per_objfile; struct dwarf2_cu *cu =3D reader->cu; @@ -7190,6 +7185,8 @@ build_type_psymtabs_reader (const struct die_reader_s= pecs *reader, struct partial_die_info *first_die; CORE_ADDR lowpc, highpc; dwarf2_psymtab *pst; + const gdb_byte *info_ptr =3D reader->info_ptr; + struct die_info *type_unit_die =3D reader->comp_unit_die; =20 gdb_assert (per_cu->is_debug_types); sig_type =3D (struct signatured_type *) per_cu; @@ -7322,8 +7319,7 @@ build_type_psymtabs (dwarf2_per_objfile *per_objfile) cutu_reader reader (tu.sig_type, per_objfile, abbrev_table.get (), nullptr, false); if (!reader.dummy_p) - build_type_psymtabs_reader (&reader, reader.info_ptr, - reader.comp_unit_die); + build_type_psymtabs_reader (&reader); } } =20 @@ -7411,8 +7407,7 @@ process_skeletonless_type_unit (void **slot, void *in= fo) /* This does the job that build_type_psymtabs would have done. */ cutu_reader reader (entry, per_objfile, nullptr, nullptr, false); if (!reader.dummy_p) - build_type_psymtabs_reader (&reader, reader.info_ptr, - reader.comp_unit_die); + build_type_psymtabs_reader (&reader); =20 return 1; }