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 48806395CC71 for ; Tue, 12 May 2020 21:12:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 48806395CC71 X-ASG-Debug-ID: 1589317951-0c856e18f31444cf0001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id xDCeob69Jr0WGcES (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 12 May 2020 17:12:31 -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 8AD7F441B21; Tue, 12 May 2020 17:12:31 -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 18/42] Add dwarf2_per_objfile parameter to recursively_compute_inclusions Date: Tue, 12 May 2020 17:11:17 -0400 X-ASG-Orig-Subj: [PATCH v2 18/42] Add dwarf2_per_objfile parameter to recursively_compute_inclusions Message-Id: <20200512211141.6073-19-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: 1589317951 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: 3395 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=-27.9 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:33 -0000 This allows removing dwarf2_per_cu_data::dwarf2_per_objfile references in recursively_compute_inclusions and compute_compunit_symtab_includes. gdb/ChangeLog: * dwarf2/read.c (recursively_compute_inclusions): Add dwarf2_per_objfile parameter. (compute_compunit_symtab_includes): Likewise. (process_cu_includes): 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 68e5d987443..bf1bbe1fd99 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -9591,7 +9591,8 @@ rust_union_quirks (struct dwarf2_cu *cu) static void recursively_compute_inclusions (std::vector *result, htab_t all_children, htab_t all_type_symtabs, - struct dwarf2_per_cu_data *per_cu, + dwarf2_per_cu_data *per_cu, + dwarf2_per_objfile *per_objfile, struct compunit_symtab *immediate_parent) { void **slot = htab_find_slot (all_children, per_cu, INSERT); @@ -9604,7 +9605,7 @@ recursively_compute_inclusions (std::vector *result, *slot = per_cu; /* Only add a CU if it has a symbol table. */ - compunit_symtab *cust = per_cu->dwarf2_per_objfile->get_symtab (per_cu); + compunit_symtab *cust = per_objfile->get_symtab (per_cu); if (cust != NULL) { /* If this is a type unit only add its symbol table if we haven't @@ -9632,7 +9633,8 @@ recursively_compute_inclusions (std::vector *result, for (dwarf2_per_cu_data *ptr : *per_cu->imported_symtabs) { recursively_compute_inclusions (result, all_children, - all_type_symtabs, ptr, cust); + all_type_symtabs, ptr, per_objfile, + cust); } } @@ -9640,7 +9642,8 @@ recursively_compute_inclusions (std::vector *result, PER_CU. */ static void -compute_compunit_symtab_includes (struct dwarf2_per_cu_data *per_cu) +compute_compunit_symtab_includes (dwarf2_per_cu_data *per_cu, + dwarf2_per_objfile *per_objfile) { gdb_assert (! per_cu->is_debug_types); @@ -9649,7 +9652,7 @@ compute_compunit_symtab_includes (struct dwarf2_per_cu_data *per_cu) int len; std::vector result_symtabs; htab_t all_children, all_type_symtabs; - compunit_symtab *cust = per_cu->dwarf2_per_objfile->get_symtab (per_cu); + compunit_symtab *cust = per_objfile->get_symtab (per_cu); /* If we don't have a symtab, we can just skip this case. */ if (cust == NULL) @@ -9663,7 +9666,8 @@ compute_compunit_symtab_includes (struct dwarf2_per_cu_data *per_cu) for (dwarf2_per_cu_data *ptr : *per_cu->imported_symtabs) { recursively_compute_inclusions (&result_symtabs, all_children, - all_type_symtabs, ptr, cust); + all_type_symtabs, ptr, per_objfile, + cust); } /* Now we have a transitive closure of all the included symtabs. */ @@ -9689,7 +9693,7 @@ process_cu_includes (struct dwarf2_per_objfile *dwarf2_per_objfile) for (dwarf2_per_cu_data *iter : dwarf2_per_objfile->per_bfd->just_read_cus) { if (! iter->is_debug_types) - compute_compunit_symtab_includes (iter); + compute_compunit_symtab_includes (iter, dwarf2_per_objfile); } dwarf2_per_objfile->per_bfd->just_read_cus.clear (); -- 2.26.2