From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id gA+UL3vvy2KDjhAAWB0awg (envelope-from ) for ; Mon, 11 Jul 2022 05:38:03 -0400 Received: by simark.ca (Postfix, from userid 112) id AAE6F1E5EA; Mon, 11 Jul 2022 05:38:03 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=qdVnUwIG; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1A34A1E21F for ; Mon, 11 Jul 2022 05:38:03 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 80193385AE6D for ; Mon, 11 Jul 2022 09:38:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 80193385AE6D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1657532282; bh=PFl0KJ/IPShSoFtE4maLd/cy9LjZQlDNpyavjN/rfSQ=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=qdVnUwIG+55U9MPibxhBOHNyRSYplbCb4R89+xNXwGEPsnK6qSFc/4hCZRE9dV7ab CZtsnhLM/Ygpx9L1U/x52+UV3NUPaPhqirwU4YHhazi+sLSJ9ZfOmg9acd3sFpySfq rZqfUyX3/6KIWi/e/wg3C7J3CG1C1eoHRgmyHe8g= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 130753858412 for ; Mon, 11 Jul 2022 09:37:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 130753858412 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 4A68022803 for ; Mon, 11 Jul 2022 09:37:40 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 36CFE13524 for ; Mon, 11 Jul 2022 09:37:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8ZQ3DGTvy2JvRAAAMHmgww (envelope-from ) for ; Mon, 11 Jul 2022 09:37:40 +0000 Date: Mon, 11 Jul 2022 11:37:38 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb/symtab] Use comp_unit_head::get_length Message-ID: <20220711093737.GA23795@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, There's a spot in read_comp_units_from_section where we explictly use initial_length_size to get the total length: ... this_cu->length = cu_header.length + cu_header.initial_length_size; ... Instead, just use cu_header.get_length (). Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/symtab] Use comp_unit_head::get_length --- gdb/dwarf2/read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 55e61b882a9..40a18796f8d 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -7207,7 +7207,7 @@ read_comp_units_from_section (dwarf2_per_objfile *per_objfile, *slot = sig_ptr; } this_cu->sect_off = sect_off; - this_cu->length = cu_header.length + cu_header.initial_length_size; + this_cu->length = cu_header.get_length (); this_cu->is_dwz = is_dwz; this_cu->section = section; /* Init this asap, to avoid a data race in the set_version in