From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 591B13858D39 for ; Mon, 13 Mar 2023 16:20:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 591B13858D39 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-out1.suse.de (Postfix) with ESMTPS id 038BB22AD9 for ; Mon, 13 Mar 2023 16:20:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1678724452; 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=uMc1YrikUtO8NjJ2cNK0bz9bI9s+r334Gp6tJBU652Q=; b=g/YV+S1vY+TtmSMXMOZE/1aaz9jaT5BF2nTjrj5RG5Q6cCmqDXld/TnSom6pgkoKDPrvP7 5V1KIszaqMc9UTeqLNYLckEQfCVEpIhRlYQuHfINDFapYPpulyF6WMOwhrtGuTfyibwNOE D5vuxI+vurMysX7PxmGhY6I2LzkJLb8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1678724452; 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=uMc1YrikUtO8NjJ2cNK0bz9bI9s+r334Gp6tJBU652Q=; b=hMFezcwzWSvquK6HBFfQBKZTZnPxln/Y7Jo1naYNxA3AkYUf75qywSuYZnmfWr87NW/iNe WjCRAILaUnXoCrCA== 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 E532F13517 for ; Mon, 13 Mar 2023 16:20:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4M3UNmNND2QbDAAAMHmgww (envelope-from ) for ; Mon, 13 Mar 2023 16:20:51 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [pushed 2/8] [gdb/testsuite] Handle USE_TUI in gdb.tui/corefile-run.exp Date: Mon, 13 Mar 2023 17:20:45 +0100 Message-Id: <20230313162051.488-3-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230313162051.488-1-tdevries@suse.de> References: <20230313162051.488-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,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: Once in a while I find myself rewriting a TUI test-case into a non-TUI test-case, to better understand whether the problem I'm looking at is related to the TUI or not. I've got the impression that I've done this sufficiently often that it's worth committing the non-TUI version, so having just written a non-TUI version of gdb.tui/corefile-run.exp, let's commit it. The non-TUI version can be enabled by doing: ... $ make check "RUNTESTFLAGS=gdb.tui/corefile-run.exp USE_TUI=0" ... Also remove hard-coding of a source line number. Tested on x86_64-linux. --- gdb/testsuite/gdb.tui/corefile-run.exp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.tui/corefile-run.exp b/gdb/testsuite/gdb.tui/corefile-run.exp index 2109a0ae3eb..6769dfbd800 100644 --- a/gdb/testsuite/gdb.tui/corefile-run.exp +++ b/gdb/testsuite/gdb.tui/corefile-run.exp @@ -40,6 +40,19 @@ if { ![gdb_gcore_cmd "$core" "save a corefile"] } { return -1 } +set src_line "return 0;" +set src_line_nr [gdb_get_line_number $src_line] + +set run_re \ + "\\\[Inferior $decimal \\\(process $decimal\\\) exited normally\\]" + +if { [info exists USE_TUI] && $USE_TUI == 0 } { + clean_restart $testfile + gdb_test "core-file $core" $src_line "load corefile" + gdb_test "run" $run_re "run until the end" + return +} + Term::clean_restart 24 80 $testfile if {![Term::enter_tui]} { unsupported "TUI not supported" @@ -51,8 +64,7 @@ gdb_assert {![string match "No Source Available" $text]} \ "initial source listing" Term::command "core-file $core" -Term::check_contents "load corefile" "21 *return 0.*$gdb_prompt .*" +Term::check_contents "load corefile" "$src_line_nr *$src_line.*$gdb_prompt .*" Term::command "run" -Term::check_contents "run until the end" \ - "\\\[Inferior $decimal \\\(process $decimal\\\) exited normally\\]" +Term::check_contents "run until the end" $run_re -- 2.35.3