From patchwork Tue Apr 21 18:08:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 6348 Received: (qmail 91959 invoked by alias); 21 Apr 2015 18:08:38 -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 91912 invoked by uid 89); 21 Apr 2015 18:08:37 -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:36 +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 (8.14.4/8.14.4) with ESMTP id t3LI8YBD009146 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 21 Apr 2015 14:08:34 -0400 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 t3LI8WKo028722 for ; Tue, 21 Apr 2015 14:08:34 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 01/24] gdb_test_multiple match eof of any spawn_id Date: Tue, 21 Apr 2015 19:08:08 +0100 Message-Id: <1429639711-16459-2-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> Since silent handling of eof is usually the wrong thing to do, this patch makes gdb_test_multiple handle it for all $any_spawn_id. Currently, against gdbserver, interrupt.exp occasionaly fails like this: FAIL: gdb.base/interrupt.exp: send end of file gdb.log with expect debug output enabled shows: expect: does "\r\n\r\nChild exited with status 0\r\nGDBserver exiting\r\n" (spawn_id exp8) match regular expression "end of file"? Gate "end of file"? gate=no expect: read eof expect: set expect_out(spawn_id) "exp8" expect: set expect_out(buffer) "\r\n\r\nChild exited with status 0\r\nGDBserver exiting\r\n" FAIL: gdb.base/interrupt.exp: send end of file Note "expect: read eof" for spawn_id=exp8. exp8 is inferior_spawn_id/gdbserver_spawn_id. That means expect/gdb_test_multiple saw gdbserver exit before we got the expected gdb output. Since there's no explicit pattern for "eof", expect (and thus gdb_test_multiple) just returns. After this commit, we get instead: ERROR: Process no longer exists UNRESOLVED: gdb.base/interrupt.exp: send end of file Note that before we still got an FAIL because $saw_inferior_exit is 0 when we get to: gdb_assert { $saw_eof && $saw_inferior_exit } $msg Fixing the fail (now unresolved) will be the subject of a separate patch. gdb/testsuite/ChangeLog: 2015-04-21 Pedro Alves * lib/gdb.exp (gdb_test_multiple): Match eof/full_buffer/timeout on $any_spawn_id instead of only on $gdb_spawn_id. --- gdb/testsuite/lib/gdb.exp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 7d8720b..73e55e3 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -692,6 +692,7 @@ proc gdb_test_multiple { command message user_code } { global inferior_exited_re upvar timeout timeout upvar expect_out expect_out + global any_spawn_id if { $message == "" } { set message $command @@ -918,6 +919,9 @@ proc gdb_test_multiple { command message user_code } { fail "$message (got breakpoint menu)" set result -1 } + + # Patterns below apply to any spawn id specified. + -i $any_spawn_id eof { perror "Process no longer exists" if { $message != "" } {