From patchwork Mon Mar 13 16:20:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 66298 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C6FBE3858004 for ; Mon, 13 Mar 2023 16:21:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C6FBE3858004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678724476; bh=+bwcH1V97hi7/dcZZ6+pJoVVeIwldNxEiGDQNDzhZr8=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=gcJBNqMj/hSKg0aoScFV7/Dvnsn1OyoZD7y40Iww3/qbxN3LpT3xtUrnwN5pHdfAD gmKemueQBJRlIQiPQlQlV7jIuwQIJKNvQ2z9q4y9ocbyHvCrY/TFke3V4y4aOr58O8 xUOy7DV/13qKNbSpXKiyJIqcvtOLuLGjIS9SYNOY= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id AE8BB3858409 for ; Mon, 13 Mar 2023 16:20:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AE8BB3858409 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 DFB8022ACD for ; Mon, 13 Mar 2023 16:20:51 +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 CDB0B13517 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 UN0jMWNND2QbDAAAMHmgww (envelope-from ) for ; Mon, 13 Mar 2023 16:20:51 +0000 To: gdb-patches@sourceware.org Subject: [pushed 1/8] [gdb/testsuite] Fix untested message in gdb.tui/corefile-run.exp Date: Mon, 13 Mar 2023 17:20:44 +0100 Message-Id: <20230313162051.488-2-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 X-Spam-Status: No, score=-12.5 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 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-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" In test-case gdb.tui/corefile-run.exp, we have this bit: ... require !use_gdb_stub if { [target_info gdb_protocol] == "extended-remote" } { untested "not supported" return } ... So with target board native-gdbserver we get: ... UNSUPPORTED: gdb.tui/corefile-run.exp: require failed: !use_gdb_stub ... and with target board native-extended-gdbserver instead: ... UNTESTED: gdb.tui/corefile-run.exp: not supported ... Fix this by: - adding an optional argument target_description to proc target_can_use_run_cmd - handling the target_description == core && [target_info gdb_protocol] == "extended-remote" case in the proc - using require {target_can_use_run_cmd core} such that now in both cases we have: ... UNSUPPORTED: gdb.tui/corefile-run.exp: require failed: \ target_can_use_run_cmd core ... Tested on x86_64-linux. --- gdb/testsuite/gdb.tui/corefile-run.exp | 6 +----- gdb/testsuite/lib/gdb.exp | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/gdb/testsuite/gdb.tui/corefile-run.exp b/gdb/testsuite/gdb.tui/corefile-run.exp index 02606ee286d..2109a0ae3eb 100644 --- a/gdb/testsuite/gdb.tui/corefile-run.exp +++ b/gdb/testsuite/gdb.tui/corefile-run.exp @@ -29,11 +29,7 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } { } # Only run on native boards. -require !use_gdb_stub -if { [target_info gdb_protocol] == "extended-remote" } { - untested "not supported" - return -} +require {target_can_use_run_cmd core} if { ![runto_main] } { return -1 diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index e2b08c64eae..23277c4ab79 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -385,13 +385,33 @@ proc delete_breakpoints {} { # Returns true iff the target supports using the "run" command. -proc target_can_use_run_cmd {} { +proc target_can_use_run_cmd { {target_description ""} } { + if { $target_description == "" } { + set have_core 0 + } elseif { $target_description == "core" } { + # We could try to figure this out by issuing an "info target" and + # checking for "Local core dump file:", but it would mean the proc + # would start requiring a current target. Also, uses while gdb + # produces non-standard output due to, say annotations would + # have to be moved around or eliminated, which would further limit + # usability. + set have_core 1 + } else { + error "invalid argument: $target_description" + } + if [target_info exists use_gdb_stub] { # In this case, when we connect, the inferior is already # running. return 0 } + if { $have_core && [target_info gdb_protocol] == "extended-remote" } { + # In this case, when we connect, the inferior is not running but + # cannot be made to run. + return 0 + } + # Assume yes. return 1 } From patchwork Mon Mar 13 16:20:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 66304 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A933138582A3 for ; Mon, 13 Mar 2023 16:22:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A933138582A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678724533; bh=uMc1YrikUtO8NjJ2cNK0bz9bI9s+r334Gp6tJBU652Q=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=XzffPF49iLxrMbqiK5ffE0KZr1SU8eqAO3kxlM3GBrxrThqla+pHfc4jeNm5OXXVe n75rWyZMB9dwZHrPT4OzvfRvQf8VkkdWnWoTzvAKx0tNERe7/WUBBFeAsBb8Dg052n kK+6RmDU5qdw7WZPGUv9htgqE+xSDLnmtUc6a1zg= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 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) 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 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 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 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-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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 From patchwork Mon Mar 13 16:20:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 66299 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DC99938582AC for ; Mon, 13 Mar 2023 16:21:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC99938582AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678724476; bh=wbBOMARfiq8NOlylojGAnEzV8b1sGOPCmDxDzljru7w=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=RzfKOQRdPLUSMDV20QFVoZaoeUeTTwzD2SIkOzLormfETjuGJInk7bCpl64N0SBNy JIaQoey1P/vKQuNLIiiJ2mgGeBb0mmDZmp8MmRPLLsW5wpSi7A3s7RaywwPKNBAGyI 4f/BczWyiPN0tg6Dy9asQYQvfHp0QwwqBi8/pfGA= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 09EC33858D32 for ; Mon, 13 Mar 2023 16:20:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 09EC33858D32 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 1C7221FE0D for ; Mon, 13 Mar 2023 16:20:52 +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 08FC213517 for ; Mon, 13 Mar 2023 16:20:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id oK4eAWRND2QbDAAAMHmgww (envelope-from ) for ; Mon, 13 Mar 2023 16:20:52 +0000 To: gdb-patches@sourceware.org Subject: [pushed 3/8] [gdb/testsuite] Require ![is_remote host] for TUI Date: Mon, 13 Mar 2023 17:20:46 +0100 Message-Id: <20230313162051.488-4-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 X-Spam-Status: No, score=-12.5 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 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-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" When running test-case gdb.tui/corefile-run.exp with both host and target board local-remote-host-native.exp, we run into: ... FAIL: gdb.tui/corefile-run.exp: load corefile ... while this passes with USE_TUI=0. The problem is that the TUI setup code uses "setenv TERM ansi", which has no effect on remote host. I can confirm this analysis by working around this problem in local-remote-host-native.exp like this: ... - spawn $RSH -t -l $username $remote $cmd + spawn $RSH -t -l $username $remote "export TERM=ansi; $cmd" ... For now, simply make TUI unsupported for remote host, by returning 0 in prepare_for_tui. Tested on x86_64-linux. --- gdb/testsuite/lib/tuiterm.exp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp index 8a3f7a48acc..05edfe9a5b1 100644 --- a/gdb/testsuite/lib/tuiterm.exp +++ b/gdb/testsuite/lib/tuiterm.exp @@ -792,6 +792,14 @@ namespace eval Term { # Setup ready for starting the tui, but don't actually start it. # Returns 1 on success, 0 if TUI tests should be skipped. proc prepare_for_tui {} { + if { [is_remote host] } { + # In clean_restart, we're using "setenv TERM ansi", which has + # effect on build. If we have [is_remote host] == 0, so + # build == host, then it also has effect on host. But for + # [is_remote host] == 1, it has no effect on host. + return 0 + } + if {![allow_tui_tests]} { return 0 } From patchwork Mon Mar 13 16:20:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 66303 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3B79C385B524 for ; Mon, 13 Mar 2023 16:22:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3B79C385B524 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678724533; bh=MODDssHFE+JknLKBlngvBSt5smovRsFC8foCAWK1r0k=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ADCOxKwio+T9Xq79q0LrPxI2yg5fVQa59t+xO21foKEKvVHZp/3jyr6h1NnJFZqiQ kbkn85jgSHfHuxwJJV6dXkAOXJ7++7QgMbp/TZ+j59oDc7FqggEaCeOjfxWSZYRNaw WNrAwRL1G8LsY8C11ETAY8vjWFr9y6XCBWIImkB0= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 07B263858D1E for ; Mon, 13 Mar 2023 16:20:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 07B263858D1E 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 3494E1FE0E for ; Mon, 13 Mar 2023 16:20:52 +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 2145613517 for ; Mon, 13 Mar 2023 16:20:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id uIABB2RND2QbDAAAMHmgww (envelope-from ) for ; Mon, 13 Mar 2023 16:20:52 +0000 To: gdb-patches@sourceware.org Subject: [pushed 4/8] [gdb/testsuite] Fix gdb.tui/tui-nl-filtered-output.exp for remote host Date: Mon, 13 Mar 2023 17:20:47 +0100 Message-Id: <20230313162051.488-5-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 X-Spam-Status: No, score=-12.5 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 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-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" When running test-case gdb.tui/tui-nl-filtered-output.exp with host board local-remote-host-notty and target board native-gdbserver, I get: ... FAIL: gdb.tui/tui-nl-filtered-output.exp: check printf output ... The problem is that Term::enter_tui is returning 0, but the test-case doesn't check for this, and consequently runs unsupported tests. Fix this by adding the missing check. Tested on x86_64-linux. --- gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp b/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp index 5b1d6b7d9ba..8f85ae7ce49 100644 --- a/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp +++ b/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp @@ -36,7 +36,10 @@ tuiterm_env # Setup and enter TUI mode. Term::clean_restart 24 80 -Term::enter_tui +if {![Term::enter_tui]} { + unsupported "TUI not supported" + return +} # Send the command, and check the output is correctly split over # multiple lines. From patchwork Mon Mar 13 16:20:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 66301 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6CC4B385E004 for ; Mon, 13 Mar 2023 16:21:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6CC4B385E004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678724505; bh=DNkl7YnUvNE0d2JGvWijaB2qPUUbSTRe41i9AMxQIjY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=hsMvadGIE0CvYfQ0eh40qjvH7K3mczyyNK3sQD77xHyAEmQaOKkK9tJZ49iDieesZ JDg4fFM8GZklNgv5ZZoIRYczGkkNs9hV7E+f9To6zIrSFN/m6JGm1Ub4GUcsXWQssu Bbf4u9RBWZNdQR078vzmk8cbBNsP/Csrvjrwm+4o= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 1FE093858414 for ; Mon, 13 Mar 2023 16:20:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1FE093858414 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 4F6801FE15 for ; Mon, 13 Mar 2023 16:20:52 +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 3C2CA13517 for ; Mon, 13 Mar 2023 16:20:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UFItDWRND2QbDAAAMHmgww (envelope-from ) for ; Mon, 13 Mar 2023 16:20:52 +0000 To: gdb-patches@sourceware.org Subject: [pushed 5/8] [gdb/testsuite] Fix gdb.tui/tui-layout.exp for remote host Date: Mon, 13 Mar 2023 17:20:48 +0100 Message-Id: <20230313162051.488-6-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 X-Spam-Status: No, score=-12.5 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 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-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" When running test-case gdb.tui/tui-layout.exp with host board local-remote-host-notty and target board native-gdbserver, I get: ... FAIL: gdb.tui/tui-layout.exp: terminal=dumb: execution=false: layout=asm: \ layout asm (timeout) ... The problem is that the test-case expects that the default "setenv TERM dumb" has effect, which is not the case for remote host. Fix this by skipping the test for remote host. Tested on x86_64-linux. --- gdb/testsuite/gdb.tui/tui-layout.exp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/testsuite/gdb.tui/tui-layout.exp b/gdb/testsuite/gdb.tui/tui-layout.exp index c7fdb1b0c0a..13823387e72 100644 --- a/gdb/testsuite/gdb.tui/tui-layout.exp +++ b/gdb/testsuite/gdb.tui/tui-layout.exp @@ -61,6 +61,10 @@ proc test_layout_or_focus {layout_name terminal execution} { } if {$dumb_terminal} { + if { [is_remote host] } { + # setenv TERM dummy has no effect on remote host. + return + } gdb_test "layout $layout_name" \ "Cannot enable the TUI: terminal doesn't support cursor addressing \\\[TERM=dumb\\\]" } else { From patchwork Mon Mar 13 16:20:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 66302 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 02B413850854 for ; Mon, 13 Mar 2023 16:22:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 02B413850854 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678724524; bh=nlNuAMxxpX8CaSFvPcxD/ALnIcpTVUsOVl79MdTYImA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=dbeC1Tama95vs4GxSsXQST0qIAYKlNdZBRygjttUB85lqZF+Ahr7vvLaJUCH6+u4I OUeo9Q9BlDvriTFi96kCiW2Jbg9aIxXp6TUShflnnNldUpPS9pNFBmJ2nrGXu5XEZ7 Zwpw6hdqQaB3D5T5rcD5tA7HhZyQVfGvVw7Oxr+w= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 9F602385841A for ; Mon, 13 Mar 2023 16:20:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9F602385841A 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 66C661FE16 for ; Mon, 13 Mar 2023 16:20:52 +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 53CE813517 for ; Mon, 13 Mar 2023 16:20:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id sPdTE2RND2QbDAAAMHmgww (envelope-from ) for ; Mon, 13 Mar 2023 16:20:52 +0000 To: gdb-patches@sourceware.org Subject: [pushed 6/8] [gdb/testsuite] Fix gdb.tui/completion.exp for local-remote-host-notty Date: Mon, 13 Mar 2023 17:20:49 +0100 Message-Id: <20230313162051.488-7-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 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 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-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" When running test-case gdb.tui/completion.exp with host board local-remote-host-notty and target board native-gdbserver, I get: ... FAIL: gdb.tui/completion.exp: completion of layout names: \ tab completion (timeout) ... The test-case contains a few tests that do tab completion, which requires readline, which is unavailable with host board local-remote-host-notty. Fix this by adding the missing check for readline_is_used. Tested on x86_64-linux. --- gdb/testsuite/gdb.tui/completion.exp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.tui/completion.exp b/gdb/testsuite/gdb.tui/completion.exp index 0a959b4ff8b..85abd4a958b 100644 --- a/gdb/testsuite/gdb.tui/completion.exp +++ b/gdb/testsuite/gdb.tui/completion.exp @@ -48,12 +48,15 @@ proc test_tab_completion {input_line expected_re} { } } -with_test_prefix "completion of layout names" { - test_tab_completion "layout" "asm *next *prev *regs *split *src *" -} +if { [readline_is_used] } { + with_test_prefix "completion of layout names" { + test_tab_completion "layout" "asm *next *prev *regs *split *src *" + } -with_test_prefix "completion of focus command" { - test_tab_completion "focus" "cmd *next *prev *src *" + + with_test_prefix "completion of focus command" { + test_tab_completion "focus" "cmd *next *prev *src *" + } } # Now run some completion tests when TUI mode is enabled. From patchwork Mon Mar 13 16:20:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 66300 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2F8833858430 for ; Mon, 13 Mar 2023 16:21:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F8833858430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678724496; bh=mxlUIKoS7ETeCbGABQr+e1a7oC7LMoQSM2/6CiSBAfU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=eyE/DGFMZF456DLazn0mm3YGfVGzNni8WCH1NOpLFE7s6g/9kvxyFbUbPaKBGkIAY QXXc1uH7sSzu86cTgYnXnHRGwfces79K2TvqmIMeATBDRj7xgWtyy05WqnJ4kEg8lb 34i/lIGIoEtKFVDyJX3Srsjx/3Rt1MxRZ2X0ykp0= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id A213F3858421 for ; Mon, 13 Mar 2023 16:20:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A213F3858421 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 7E4421FE17 for ; Mon, 13 Mar 2023 16:20:52 +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 6B60813517 for ; Mon, 13 Mar 2023 16:20:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id iDofGWRND2QbDAAAMHmgww (envelope-from ) for ; Mon, 13 Mar 2023 16:20:52 +0000 To: gdb-patches@sourceware.org Subject: [pushed 7/8] [gdb/testsuite] Fix gdb.python/tui-window.exp for remote host Date: Mon, 13 Mar 2023 17:20:50 +0100 Message-Id: <20230313162051.488-8-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 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, 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 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-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" When running gdb.python/tui-window.exp with host board local-remote-host-notty and target board native-gdbserver, I get: ... UNSUPPORTED: gdb.python/tui-window.exp: TUI not supported FAIL: gdb.python/tui-window.exp: test title ... Fix this by adding the missing return after the unsupported. Tested on x86_64-linux. --- gdb/testsuite/gdb.python/tui-window.exp | 1 + 1 file changed, 1 insertion(+) diff --git a/gdb/testsuite/gdb.python/tui-window.exp b/gdb/testsuite/gdb.python/tui-window.exp index af2a866e78b..9b5d17c35d4 100644 --- a/gdb/testsuite/gdb.python/tui-window.exp +++ b/gdb/testsuite/gdb.python/tui-window.exp @@ -40,6 +40,7 @@ gdb_test_no_output "tui new-layout fail fail 1 status 0 cmd 1" if {![Term::enter_tui]} { unsupported "TUI not supported" + return } Term::command "layout test" From patchwork Mon Mar 13 16:20:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 66305 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5A15A385B516 for ; Mon, 13 Mar 2023 16:22:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5A15A385B516 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678724561; bh=xn69a5N9E7pxuUgQe8hlGfbkHlwR1G1JO3I7J1X8Rc4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Qj6XKDdiBA1vkqh6XLdZanOdMceDAROTb1N2w+ThBnnXNut3J1ewDNMsbuUpJ/W3K CsFSegpdsZhhoELEfOBRtBWu6KVX8DbKQWmFi8xzLkekF09yrmUIuDjxAhzXL3CWdR sCJrU0yJ6gkr5RiAEzGwoUxcl5ww8QlOF3Zzu27M= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 3D05D3858C00 for ; Mon, 13 Mar 2023 16:20:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3D05D3858C00 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 9694E1FE14 for ; Mon, 13 Mar 2023 16:20:52 +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 8427513517 for ; Mon, 13 Mar 2023 16:20:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UFQUH2RND2QbDAAAMHmgww (envelope-from ) for ; Mon, 13 Mar 2023 16:20:52 +0000 To: gdb-patches@sourceware.org Subject: [pushed 8/8] [gdb/testsuite] Fix gdb.python/tui-window-factory.exp for remote host Date: Mon, 13 Mar 2023 17:20:51 +0100 Message-Id: <20230313162051.488-9-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 X-Spam-Status: No, score=-12.5 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 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-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" When running gdb.python/tui-window.exp with host board local-remote-host-notty and target board native-gdbserver, I get: ... FAIL: gdb.python/tui-window-factory.exp: msg_2: \ check test_window box (box check: ul corner is l, not +) ... The problem is that the result of Term::prepare_for_tui is not checked. Fix this by adding the missing check. Tested on x86_64-linux. --- gdb/testsuite/gdb.python/tui-window-factory.exp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.python/tui-window-factory.exp b/gdb/testsuite/gdb.python/tui-window-factory.exp index 3e898d01c7b..e3b403bdea0 100644 --- a/gdb/testsuite/gdb.python/tui-window-factory.exp +++ b/gdb/testsuite/gdb.python/tui-window-factory.exp @@ -32,7 +32,10 @@ set pyfile [gdb_remote_download host \ ${srcdir}/${subdir}/${gdb_test_file_name}.py] Term::clean_restart 24 80 -Term::prepare_for_tui +if { ![Term::prepare_for_tui] } { + unsupported "TUI not supported" + return +} gdb_test "source ${pyfile}" "Python script imported" \ "import python scripts"