From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IR11B3eBJ2FQKQAAWB0awg (envelope-from ) for ; Thu, 26 Aug 2021 07:56:39 -0400 Received: by simark.ca (Postfix, from userid 112) id 104B21EE1B; Thu, 26 Aug 2021 07:56:39 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 4AAA11EDEE for ; Thu, 26 Aug 2021 07:56:38 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 971D8385842B for ; Thu, 26 Aug 2021 11:56:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 971D8385842B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1629978997; bh=bi+Zb2VNV51GW8tTmZBof/yE9yhVopY7TXplFwQXWbw=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=vNOxnASvhRsfD+GoHfcKXZiuodOnOfGRSsbPt9gvia/9HEfW+1aEEeNM9ZQfXGNoR h54Yy61ZmZyu5rqqTfme2jeIeAhB/hmu8xj5oePHL7hNRK7gJ+FatDbYdVaBa7drNE vu9BRUf5U8vzBXFUQ0uLQsGGrJFMzB7l/VKul9mc= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id AAB123858402 for ; Thu, 26 Aug 2021 11:56:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AAB123858402 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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 CDAB32019C for ; Thu, 26 Aug 2021 11:56:08 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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 imap1.suse-dmz.suse.de (Postfix) with ESMTPS id BB68B13318 for ; Thu, 26 Aug 2021 11:56:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id DHeoLFiBJ2GhPQAAGKfGzw (envelope-from ) for ; Thu, 26 Aug 2021 11:56:08 +0000 Date: Thu, 26 Aug 2021 13:56:07 +0200 To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Add label option to proc cu Message-ID: <20210826115605.GA22680@delia> 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, We can use current dwarf assembly infrastructure to declare a label that marks the start of the CU header: ... declare_labels header_start_cu_a _section ".debug_info" header_start_cu_a : cu {} { } _section ".debug_info" header_start_cu_b : cu {} { } ... on the condition that we switch to the .debug_info section before, which makes this style of use fragile. Another way to achieve the same is to use the label as generated by the cu proc itself: ... variable _cu_label cu {} { } set header_start_cu_a $_cu_label cu {} { } set header_start_cu_b $_cu_label ... but again that seems fragile given that adding a new CU inbetween will silently result in the wrong value for the label. Add a label option to proc cu such that we can simply do: ... declare_labels header_start_cu_a cu { label header_start_cu_a } { } cu { label header_start_cu_b } { } ... Tested on x86_64-linux. Any comments? Thanks, - Tom [gdb/testsuite] Add label option to proc cu --- gdb/testsuite/lib/dwarf.exp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index ce7b5983ab9..8dda798ddf8 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -1258,6 +1258,10 @@ namespace eval Dwarf { # default = default # fission 0|1 - boolean indicating if generating Fission debug info # default = 0 + # label