From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8FnBOv8RZGGKJAAAWB0awg (envelope-from ) for ; Mon, 11 Oct 2021 06:29:19 -0400 Received: by simark.ca (Postfix, from userid 112) id EEF6E1F3CB; Mon, 11 Oct 2021 06:29:19 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 57EF11E813 for ; Mon, 11 Oct 2021 06:29:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 07F62385803C for ; Mon, 11 Oct 2021 10:29:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 07F62385803C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1633948159; bh=+pPrFanCqlhDQiOlHfOYZiw402sQZzLxEJsST/PYX3s=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=u6XIQgt34teNU/Q3DZ+CRLRc1AcdWmEVEht012bZuuXhAQNMIRbRw5gZpSv/BzAkk IrXRZKAxXU/Zd3X2j6nA7spmLA8E6z4Jbj3JPxG6HiimRkPILU6XrtnOT5Un+Uz4dD IxQRIm2BgZUnf503PO3urcW2t7emxYyTX+5o/JXU= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 50E393858024 for ; Mon, 11 Oct 2021 10:29:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 50E393858024 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 8D11921F22 for ; Mon, 11 Oct 2021 10:29:00 +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 7ABEF13C4C for ; Mon, 11 Oct 2021 10:29:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id c4wBHewRZGFNOQAAMHmgww (envelope-from ) for ; Mon, 11 Oct 2021 10:29:00 +0000 Date: Mon, 11 Oct 2021 12:28:59 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.dwarf2/gdb-add-index-symlink.exp Message-ID: <20211011102854.GA21618@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, The test-case gdb.dwarf2/gdb-add-index-symlink.exp interpretes a failure to add an index as a failure to add an index for a symlink: ... if { [ensure_gdb_index $symlink] == -1 } { fail "Unable to call gdb-add-index with a symlink to a symfile" return -1 } ... However, it's possible that the gdb-add-index also fails with a regular file. Add a check for that situation. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.dwarf2/gdb-add-index-symlink.exp --- gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp index eaeddec0250..74c558ad231 100644 --- a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp +++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp @@ -22,6 +22,19 @@ if {![dwarf2_support]} { standard_testfile main.c +# First check whether we can actually handle the non-symlink case. +with_test_prefix non-symlink { + if { [prepare_for_testing "failed to prepare" "${testfile}" \ + [list ${srcfile}]] } { + return -1 + } + + if { [ensure_gdb_index $binfile] == -1 } { + return -1 + } +} + +# Regenerate exec without index. if { [prepare_for_testing "failed to prepare" "${testfile}" \ [list ${srcfile}]] } { return -1