From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 From: Tom de Vries 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-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Mon, 11 Jul 2022 09:37:43 -0000 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