From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 8C1023858D38 for ; Fri, 8 Sep 2023 10:28:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8C1023858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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-out2.suse.de (Postfix) with ESMTPS id 647CB1FD81 for ; Fri, 8 Sep 2023 10:28:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1694168888; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fPUDwbAL6EwNSNsk2E9odrZIjq3cb8Iat0c9hdy30Dg=; b=uy3D0/JU6vR3F8kQIp4E7G/vuqSM7fBmw2is4DfI+H5EIfUjpXaeUgmoQYW1H8DRSCWiBo rF7a537lwtbUbHcnMMDcVVb1In6DF780QEZKVQb30467l74MqyejbJRs6vTAe/li/IQv1z cEakFJbC7yU1z4fyXlrEY9rdWvi9s3k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1694168888; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fPUDwbAL6EwNSNsk2E9odrZIjq3cb8Iat0c9hdy30Dg=; b=P3LLx7h1+GZS5QERHk2hHKnuTTNCFDOmHysALXdXMzmX3VSH+rIHIKr1ewc9Gh8nR4z6ls rAMkcInwSgac/FCQ== 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 51834131FD for ; Fri, 8 Sep 2023 10:28:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CN7KEjj3+mTRdQAAMHmgww (envelope-from ) for ; Fri, 08 Sep 2023 10:28:08 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [pushed 2/4] [gdb/testsuite] Add aranges in gdb.dwarf2/dwzbuildid.exp Date: Fri, 8 Sep 2023 12:28:04 +0200 Message-Id: <20230908102806.13015-2-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230908102806.13015-1-tdevries@suse.de> References: <20230908102806.13015-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.9 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: While investigating the execs of gdb.dwarf2/dwzbuildid.exp using readelf I ran into a warning: ... $ readelf -w dwzbuildid-ok > READELF readelf: Warning: .debug_info offset of 0x2e in .debug_aranges section does not point to a CU header. ... AFAICT, the warning is incorrect, I've filed PR binutils/30835 about that. While looking at the .debug_aranges section, I noticed that the entries for the CUs generated by the dwarf assembler are missing. Fix this by adding the missing .debug_aranges entries. Tested on x86_64-linux. --- gdb/testsuite/gdb.dwarf2/dwzbuildid.exp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp b/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp index 1aad712e32c..721aef8d344 100644 --- a/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp +++ b/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp @@ -46,10 +46,13 @@ proc write_just_debugaltlink {filename dwzname buildid} { # Only the DWARF reader checks .gnu_debugaltlink, so make sure # there is a bit of DWARF in here. - cu {} { + cu { label cu_start } { compile_unit {{language @DW_LANG_C}} { } } + aranges {} cu_start { + arange {} 0 0 + } } } @@ -65,7 +68,7 @@ proc write_dwarf_file {filename buildid {value 99}} { build_id $buildid - cu {} { + cu { label cu_start } { compile_unit {{language @DW_LANG_C}} { int_label2: base_type { {name int} @@ -80,6 +83,10 @@ proc write_dwarf_file {filename buildid {value 99}} { } } } + + aranges {} cu_start { + arange {} 0 0 + } } } -- 2.35.3