From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94657 invoked by alias); 16 Nov 2017 17:23:18 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 93902 invoked by uid 89); 16 Nov 2017 17:23:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,KB_WAM_FROM_NAME_SINGLEWORD,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=super 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; Thu, 16 Nov 2017 17:23:16 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A60075F7B5; Thu, 16 Nov 2017 17:23:15 +0000 (UTC) Received: from cascais.localdomain (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEC8E6061B; Thu, 16 Nov 2017 17:23:14 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Fix testing gdb.rust/modules.exp against gdbserver Date: Thu, 16 Nov 2017 17:23:00 -0000 Message-Id: <1510852993-26330-1-git-send-email-palves@redhat.com> X-SW-Source: 2017-11/txt/msg00315.txt.bz2 Currently several testsin gdb.rust/modules.exp fail with --target_board=native-gdbserver: Running src/gdb/testsuite/gdb.rust/modules.exp ... FAIL: gdb.rust/modules.exp: call f3() FAIL: gdb.rust/modules.exp: call self::f2() FAIL: gdb.rust/modules.exp: call self::super::f2() FAIL: gdb.rust/modules.exp: call super::f2() FAIL: gdb.rust/modules.exp: call self::super::super::f2() FAIL: gdb.rust/modules.exp: call super::super::f2() FAIL: gdb.rust/modules.exp: call ::f2() FAIL: gdb.rust/modules.exp: call extern modules::mod1::f2() This is because these tests rely on matching inferior output. However, when testing with gdbserver, inferior output goes to a separate terminal instead of to gdb's terminal, and so gdb_test won't cut it, as that is only reading from gdb's pty/gdb_spawn_id: (gdb) call f3() (gdb) FAIL: gdb.rust/modules.exp: call f3() call self::f2() (gdb) FAIL: gdb.rust/modules.exp: call self::f2() Fix this by using gdb_test_stdio instead, which handles output coming out of gdbserver's pty. Also, skip the tests if the target/board doesn't support inferior I/O at all. gdb/ChangeLog: 2017-11-16 Pedro Alves * gdb.rust/modules.exp: Skip tests that rely on inferior I/O if gdb,noinferiorio is set, and use gdb_test_stdio otherwise. --- gdb/testsuite/gdb.rust/modules.exp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/gdb/testsuite/gdb.rust/modules.exp b/gdb/testsuite/gdb.rust/modules.exp index a2a5804..eda981d 100644 --- a/gdb/testsuite/gdb.rust/modules.exp +++ b/gdb/testsuite/gdb.rust/modules.exp @@ -35,16 +35,18 @@ if {![runto ${srcfile}:$line]} { # https://github.com/rust-lang/rust/issues/33121 # gdb_test "call f2()" "lambda f2" -gdb_test "call f3()" "mod1::inner::innest::f3" -gdb_test "call self::f2()" "mod1::inner::innest::f2" -gdb_test "call self::super::f2()" "mod1::inner::f2" -gdb_test "call super::f2()" "mod1::inner::f2" -gdb_test "call self::super::super::f2()" "mod1::f2" -gdb_test "call super::super::f2()" "mod1::f2" -gdb_test "call ::f2()" "::f2" +if ![target_info exists gdb,noinferiorio] { + gdb_test_stdio "call f3()" "mod1::inner::innest::f3" + gdb_test_stdio "call self::f2()" "mod1::inner::innest::f2" + gdb_test_stdio "call self::super::f2()" "mod1::inner::f2" + gdb_test_stdio "call super::f2()" "mod1::inner::f2" + gdb_test_stdio "call self::super::super::f2()" "mod1::f2" + gdb_test_stdio "call super::super::f2()" "mod1::f2" + gdb_test_stdio "call ::f2()" "::f2" + gdb_test_stdio "call extern modules::mod1::f2()" "mod1::f2" +} gdb_test "call super::super::super::f2()" \ "Too many super:: uses from 'modules::mod1::inner::innest'" -gdb_test "call extern modules::mod1::f2()" "mod1::f2" gdb_test_sequence "ptype ::Generic::<::Generic<::Type> >" "" { "type = struct modules::Generic> \\(" -- 2.5.5