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 6BF183835C0F for ; Mon, 2 Aug 2021 13:32:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6BF183835C0F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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-out1.suse.de (Postfix) with ESMTPS id A0F1B21B30 for ; Mon, 2 Aug 2021 13:32:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1627911174; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=UCLaP7pOw/8KlFLxkQ6fK0Q+lSEsR6KXzMptxd3zBYY=; b=tfWqjbJeOZxEAM/1hJEe3cleTdfMNkqCpZj27AZKelpABcg+VvyJO9IXj/HpWlLOb1+Vuo c3nBmav9LnaNan/RWJLxakRV0QHFs3AvrGSg07Af9pfuk95ZIrfHi1kKs731jQhzcuCrxh E2lBcdn6Hduy7cr5qavYBLE01FH1wO4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1627911174; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=UCLaP7pOw/8KlFLxkQ6fK0Q+lSEsR6KXzMptxd3zBYY=; b=wzBxb8jtiXv+jIh+7f4hCN3DBjBT+gDOZShl9XfE+eXWmGP810klZ52mlZOWTBxLLMjkot sXQDehPSkQrwQ2AQ== 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 8E06313983 for ; Mon, 2 Aug 2021 13:32:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id tAagIQb0B2EYZwAAGKfGzw (envelope-from ) for ; Mon, 02 Aug 2021 13:32:54 +0000 Date: Mon, 2 Aug 2021 15:32:53 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.dwarf2/gdb-index-nodebug.exp with cc-with-gdb-index Message-ID: <20210802133251.GA8580@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-Spam-Status: No, score=-12.0 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 02 Aug 2021 13:32:56 -0000 Hi, When running with target board cc-with-gdb-index, we run into: ... (gdb) save gdb-index .^M Error while writing index for `gdb-index-nodebug': \ Cannot use an index to create the index^M (gdb) FAIL: gdb.dwarf2/gdb-index-nodebug.exp: try to save gdb index ... Fix this by detecting an already present index, and marking the test unsupported. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.dwarf2/gdb-index-nodebug.exp with cc-with-gdb-index gdb/testsuite/ChangeLog: 2021-08-02 Tom de Vries * gdb.dwarf2/gdb-index-nodebug.exp: Mark unsupported when index already present. --- gdb/testsuite/gdb.dwarf2/gdb-index-nodebug.exp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/gdb-index-nodebug.exp b/gdb/testsuite/gdb.dwarf2/gdb-index-nodebug.exp index 27b46d4cea5..6eb34f9f2c4 100644 --- a/gdb/testsuite/gdb.dwarf2/gdb-index-nodebug.exp +++ b/gdb/testsuite/gdb.dwarf2/gdb-index-nodebug.exp @@ -22,7 +22,26 @@ if {[prepare_for_testing "failed to prepare" "${testfile}" \ return -1 } +set have_index [have_index $binfile] +set have_index_re \ + [list \ + "Error while writing index for \[^\r\n\]*:" \ + "Cannot use an index to create the index"] +set have_index_re [join $have_index_re] +set readnow_p [readnow] + set index_file ${testfile}.gdb-index # The bug was that gdb would crash here. -gdb_test_no_output "save gdb-index [file dirname ${index_file}]" \ - "try to save gdb index" +set cmd "save gdb-index [file dirname ${index_file}]" +gdb_test_multiple $cmd "try to save gdb index" { + -re -wrap $have_index_re { + if { $have_index != "" || $readnow_p } { + unsupported $gdb_test_name + } else { + fail $gdb_test_name + } + } + -re -wrap "^$cmd" { + pass $gdb_test_name + } +}