From patchwork Fri Oct 13 12:52:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 23541 Received: (qmail 5463 invoked by alias); 13 Oct 2017 12:52:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 5451 invoked by uid 89); 13 Oct 2017 12:52:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Oct 2017 12:52:19 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A077A61467 for ; Fri, 13 Oct 2017 12:52:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A077A61467 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from cascais.lan (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 104865C550 for ; Fri, 13 Oct 2017 12:52:17 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [pushed] Fix gdb.base/term.exp on non-"target native" boards Date: Fri, 13 Oct 2017 13:52:16 +0100 Message-Id: <1507899136-21504-1-git-send-email-palves@redhat.com> With --target_board=native-extended-gdbserver, we get: Running .../src/gdb/testsuite/gdb.base/term.exp ... FAIL: gdb.base/term.exp: info terminal at breakpoint (gdb) info terminal No saved terminal information. Fix it by running the test everywhere, and expecting different output on non-native targets. gdb/testsuite/ChangeLog: 2017-10-13 Pedro Alves * gdb.base/term.exp: Don't skip if is_remote target. Instead, expect different "info terminal" output if testing with a non-native target. --- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.base/term.exp | 18 ++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 8a91202..73389ae 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,4 +1,10 @@ 2017-10-13 Pedro Alves + + * gdb.base/term.exp: Don't skip if is_remote target. Instead, + expect different "info terminal" output if testing with a + non-native target. + +2017-10-13 Pedro Alves Simon Marchi PR python/12966 diff --git a/gdb/testsuite/gdb.base/term.exp b/gdb/testsuite/gdb.base/term.exp index c922deb..2c38816 100644 --- a/gdb/testsuite/gdb.base/term.exp +++ b/gdb/testsuite/gdb.base/term.exp @@ -13,11 +13,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Don't try this for remote targets. -if [is_remote target] then { - continue -} - if { [prepare_for_testing "failed to prepare" term term.c] } { return -1 } @@ -33,9 +28,16 @@ if ![runto_main] then { } # Once while the program is running and stopped. -gdb_test "info terminal" \ - "Inferior's terminal status .currently saved by GDB.:.*" \ - "info terminal at breakpoint" + +# While only native targets save terminal status, we still test +# everywhere to make sure that the command doesn't misbehave. +if {[target_info gdb_protocol] == ""} { + set term_re "Inferior's terminal status .currently saved by GDB.:.*" +} else { + set term_re "No saved terminal information\\." +} + +gdb_test "info terminal" $term_re "info terminal at breakpoint" gdb_continue_to_end