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 C3F3C395CC30 for ; Tue, 12 May 2020 21:12:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C3F3C395CC30 X-ASG-Debug-ID: 1589317947-0c856e18f31444cd0001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id SVn5kmwYzjuJAAFe (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 12 May 2020 17:12:27 -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 09F8C441B21; Tue, 12 May 2020 17:12:27 -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 Subject: [PATCH v2 15/42] Make queue_and_load_dwo_tu receive a dwarf2_cu Date: Tue, 12 May 2020 17:11:14 -0400 X-ASG-Orig-Subj: [PATCH v2 15/42] Make queue_and_load_dwo_tu receive a dwarf2_cu Message-Id: <20200512211141.6073-16-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: 1589317947 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: 2673 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.4 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:28 -0000 From: Simon Marchi queue_and_load_dwo_tu, used as a callback for htab_traverse_noresize, currently receives a dwarf2_per_cu_data as its `info` user data. It accesses the current dwarf2_cu object through the dwarf2_per_cu_data::cu field. This field will be removed, because the dwarf2_per_cu_data will become objfile-independent, while dwarf_cu will remain objfile-dependent. To remove references to this field, change queue_and_load_dwo_tu so that it expects to receive a pointer to the dwarf2_cu as its info parameter. A reference to dwarf2_per_cu_data::cu needs to be added, but it will get removed in a subsequent patch, when this function gets re-worked. I kept this as a separate patch, because since there's no strong typing here, it's easy to miss something. gdb/ChangeLog: * dwarf2/read.c (queue_and_load_dwo_tu): Expect a dwarf2_cu as the info parameter. (queue_and_load_all_dwo_tus): Pass per_cu->cu. --- gdb/dwarf2/read.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 2d6b9e1a73d..3138e961bc9 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -12792,10 +12792,9 @@ static int queue_and_load_dwo_tu (void **slot, void *info) { struct dwo_unit *dwo_unit = (struct dwo_unit *) *slot; - struct dwarf2_per_cu_data *per_cu = (struct dwarf2_per_cu_data *) info; + dwarf2_cu *cu = (dwarf2_cu *) info; ULONGEST signature = dwo_unit->signature; - struct signatured_type *sig_type = - lookup_dwo_signatured_type (per_cu->cu, signature); + signatured_type *sig_type = lookup_dwo_signatured_type (cu, signature); if (sig_type != NULL) { @@ -12804,9 +12803,9 @@ queue_and_load_dwo_tu (void **slot, void *info) /* We pass NULL for DEPENDENT_CU because we don't yet know if there's a real dependency of PER_CU on SIG_TYPE. That is detected later while processing PER_CU. */ - if (maybe_queue_comp_unit (NULL, sig_cu, per_cu->cu->language)) - load_full_type_unit (sig_cu, per_cu->cu->per_objfile); - per_cu->imported_symtabs_push (sig_cu); + if (maybe_queue_comp_unit (NULL, sig_cu, cu->language)) + load_full_type_unit (sig_cu, cu->per_objfile); + cu->per_cu->imported_symtabs_push (sig_cu); } return 1; @@ -12833,7 +12832,7 @@ queue_and_load_all_dwo_tus (struct dwarf2_per_cu_data *per_cu) dwo_file = dwo_unit->dwo_file; if (dwo_file->tus != NULL) htab_traverse_noresize (dwo_file->tus.get (), queue_and_load_dwo_tu, - per_cu); + per_cu->cu); } /* Read in various DIEs. */ -- 2.26.2