From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id CCE18395CC38 for ; Tue, 12 May 2020 21:12:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CCE18395CC38 X-ASG-Debug-ID: 1589317948-0c856e18f31444ce0001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id pk8EoZIj9o0C7CsN (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 12 May 2020 17:12:28 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from epycamd.internal.efficios.com (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) by smtp.ebox.ca (Postfix) with ESMTP id 1D08D441B21; Tue, 12 May 2020 17:12:28 -0400 (EDT) From: Simon Marchi X-Barracuda-Effective-Source-IP: 192-222-181-218.qc.cable.ebox.net[192.222.181.218] X-Barracuda-Apparent-Source-IP: 192.222.181.218 X-Barracuda-RBL-IP: 192.222.181.218 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH v2 17/42] Add dwarf2_per_objfile parameter to create_partial_symtab Date: Tue, 12 May 2020 17:11:16 -0400 X-ASG-Orig-Subj: [PATCH v2 17/42] Add dwarf2_per_objfile parameter to create_partial_symtab Message-Id: <20200512211141.6073-18-simon.marchi@efficios.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512210913.5593-1-simon.marchi@efficios.com> References: <20200512210913.5593-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1589317948 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 3211 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.81805 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-28.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 21:12:30 -0000 This allows removing a dwarf2_per_cu_data::dwarf2_per_objfile reference. gdb/ChangeLog: * dwarf2/read.c (create_partial_symtab): Add dwarf2_per_objfile parameter. (create_type_unit_group): Update. (process_psymtab_comp_unit_reader): Update. (build_type_psymtabs_reader): Update. --- gdb/dwarf2/read.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index d028e86c356..68e5d987443 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -1204,7 +1204,8 @@ static void dwarf2_find_base_address (struct die_info *die, struct dwarf2_cu *cu); static dwarf2_psymtab *create_partial_symtab - (struct dwarf2_per_cu_data *per_cu, const char *name); + (dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, + const char *name); static void build_type_psymtabs_reader (const struct die_reader_specs *reader, const gdb_byte *info_ptr, @@ -7293,7 +7294,7 @@ create_type_unit_group (struct dwarf2_cu *cu, sect_offset line_offset_struct) else name = string_printf ("", line_offset); - pst = create_partial_symtab (per_cu, name.c_str ()); + pst = create_partial_symtab (per_cu, dwarf2_per_objfile, name.c_str ()); pst->anonymous = true; } @@ -7367,9 +7368,11 @@ get_type_unit_group (struct dwarf2_cu *cu, const struct attribute *stmt_list) dirname, textlow, texthigh. */ static dwarf2_psymtab * -create_partial_symtab (struct dwarf2_per_cu_data *per_cu, const char *name) +create_partial_symtab (dwarf2_per_cu_data *per_cu, + dwarf2_per_objfile *per_objfile, + const char *name) { - struct objfile *objfile = per_cu->dwarf2_per_objfile->objfile; + struct objfile *objfile = per_objfile->objfile; dwarf2_psymtab *pst; pst = new dwarf2_psymtab (name, objfile, per_cu); @@ -7391,7 +7394,8 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader, enum language pretend_language) { struct dwarf2_cu *cu = reader->cu; - struct objfile *objfile = cu->per_objfile->objfile; + dwarf2_per_objfile *per_objfile = cu->per_objfile; + struct objfile *objfile = per_objfile->objfile; struct gdbarch *gdbarch = objfile->arch (); struct dwarf2_per_cu_data *per_cu = cu->per_cu; CORE_ADDR baseaddr; @@ -7418,7 +7422,7 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader, filename = debug_filename.get (); } - pst = create_partial_symtab (per_cu, filename); + pst = create_partial_symtab (per_cu, per_objfile, filename); /* This must be done before calling dwarf2_build_include_psymtabs. */ pst->dirname = dwarf2_string_attr (comp_unit_die, DW_AT_comp_dir, cu); @@ -7599,7 +7603,7 @@ build_type_psymtabs_reader (const struct die_reader_specs *reader, tu_group->tus->push_back (sig_type); prepare_one_comp_unit (cu, type_unit_die, language_minimal); - pst = create_partial_symtab (per_cu, ""); + pst = create_partial_symtab (per_cu, dwarf2_per_objfile, ""); pst->anonymous = true; first_die = load_partial_dies (reader, info_ptr, 1); -- 2.26.2