From patchwork Tue Apr 21 18:08:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 6364 Received: (qmail 97065 invoked by alias); 21 Apr 2015 18:09:06 -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 95751 invoked by uid 89); 21 Apr 2015 18:08:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 21 Apr 2015 18:08:54 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 497A88E6F0 for ; Tue, 21 Apr 2015 18:08:53 +0000 (UTC) Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3LI8WL8028722 for ; Tue, 21 Apr 2015 14:08:52 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 19/24] Make gdb.gdb/selftest.exp use '-i $inferior_spawn_id' Date: Tue, 21 Apr 2015 19:08:26 +0100 Message-Id: <1429639711-16459-20-git-send-email-palves@redhat.com> In-Reply-To: <1429639711-16459-1-git-send-email-palves@redhat.com> References: <1429639711-16459-1-git-send-email-palves@redhat.com> gdb/testsuite/ChangeLog: 2015-04-21 Pedro Alves * gdb.gdb/selftest.exp (test_with_self): Update comment. Use send_inferior and $inferior_spawn_id. --- gdb/testsuite/gdb.gdb/selftest.exp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp index 9f25a48..a170f73 100644 --- a/gdb/testsuite/gdb.gdb/selftest.exp +++ b/gdb/testsuite/gdb.gdb/selftest.exp @@ -257,6 +257,7 @@ proc test_with_self { executable } { global decimal global timeout global INTERNAL_GDBFLAGS + global inferior_spawn_id gdb_spawn_id # load yourself into the debugger # This can take a relatively long time, particularly for testing where @@ -406,24 +407,27 @@ proc test_with_self { executable } { # start the "xgdb" process if [target_info exists gdb,noinferiorio] { - # Maybe testing with a local extended-remote gdbserver. With - # no way to interact with inferior GDB, all we can do is let - # it run. + # With no way to interact with the inferior GDB, all we can do + # is let it run. send_gdb "continue\n" # Wait a bit while the inferior gdb gets to its prompt. sleep 1 } else { set test "xgdb is at prompt" gdb_test_multiple "continue" $test { + -i "$inferior_spawn_id" -re "GNU gdb \[0-9\.\]*.*Copyright \\(C\\) \[0-9\]* Free Software Foundation, Inc.*License GPLv3\\+: GNU GPL version 3 or later .*This is free software: you are free to change and redistribute it.*There is NO WARRANTY, to the extent permitted by law. Type \"show copying\".*and \"show warranty\" for details.*This GDB was configured as .*$gdb_prompt $" { pass $test } } # set xgdb prompt so we can tell which is which - gdb_test_multiple "set prompt (xgdb) " "Set xgdb_prompt" { + send_inferior "set prompt (xgdb) \n" + set msg "Set xgdb_prompt" + gdb_test_multiple "" $msg { + -i "$inferior_spawn_id" -re "\[(\]xgdb\[)\].*\[(\]xgdb\[)\] $" { - pass "Set xgdb prompt" + pass $msg } } }