From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13068 invoked by alias); 1 Sep 2005 22:12:09 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 13050 invoked by uid 22791); 1 Sep 2005 22:12:03 -0000 Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 01 Sep 2005 22:12:03 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id j81MBq2P014347; Fri, 2 Sep 2005 00:11:52 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id j81MBqDl024998; Fri, 2 Sep 2005 00:11:52 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id j81MBfX1004484; Fri, 2 Sep 2005 00:11:41 +0200 (CEST) Date: Thu, 01 Sep 2005 22:12:00 -0000 Message-Id: <200509012211.j81MBfX1004484@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: bob@brasko.net CC: gdb-patches@sources.redhat.com In-reply-to: <20050901005200.GA6990@white> (message from Bob Rossi on Wed, 31 Aug 2005 20:52:00 -0400) Subject: Re: MI testsuite to use PTY for inferior References: <20050727031758.GA15798@white> <200508132151.j7DLpnoR015475@elgar.sibelius.xs4all.nl> <20050819222721.GA20029@white> <20050830025203.GA16646@nevyn.them.org> <20050901005200.GA6990@white> X-SW-Source: 2005-09/txt/msg00005.txt.bz2 > Date: Wed, 31 Aug 2005 20:52:00 -0400 > From: Bob Rossi > > Index: gdb/testsuite/lib/mi-support.exp > =================================================================== > RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v > retrieving revision 1.30 > diff -u -r1.30 mi-support.exp > --- gdb/testsuite/lib/mi-support.exp 9 Aug 2005 19:00:16 -0000 1.30 > +++ gdb/testsuite/lib/mi-support.exp 1 Sep 2005 00:46:01 -0000 > @@ -659,7 +659,15 @@ > gdb_start > set result -1 > } > - -re "\[\r\n\]*($pattern)\[\r\n\]+$mi_gdb_prompt\[ \]*$" { > + -re "\[\r\n\]*($pattern)\[\r\n\]+$mi_gdb_prompt\[ \]*" { > + # NOTE, there is no trailing anchor because with GDB/MI, > + # asynchronous responses can happen at any point, causing more > + # data to be available. Normally an anchor is used to make > + # sure the end of the output is matched, however, $mi_gdb_prompt > + # is just as good of an anchor since mi_gdb_test is meant to > + # match a single mi output command. If a second GDB/MI output > + # response is sent, it will be in the buffer for the next > + # time mi_gdb_test is called. > if ![string match "" $message] then { > pass "$message" > } > > Basically, this passes the mi-console.exp testcase if the 'sleep 1' is > there or not. Also, it didn't break any testcases. It changes > mi_gdb_test to enforce the fact that only a single MI output command can > be matched. What do you think? Fixes the problems in mi-console.exp, but I still see the following: 403-exec-continue 403^running (gdb) FAIL: gdb.mi/mi-syn-frame.exp: testing exec continue 403*stopped (gdb) 404-stack-list-frames 0 0 404^done,stack=[frame={level="0",addr="0x1c0006c8",func="main",file="../../../.. /src/gdb/gdb/testsuite/gdb.mi/mi-syn-frame.c",fullname="/home/kettenis/src/gdb/g db/testsuite/gdb.mi/mi-syn-frame.c",line="14"}] (gdb) PASS: gdb.mi/mi-syn-frame.exp: list stack frames Seems the attached patch solves those though. Mark Index: ChangeLog from Mark Kettenis * gdb.mi/mi-syn-frame.exp (my_mi_gdb_prompt): Remove. Split tests that were using this variable. Index: gdb.mi/mi-syn-frame.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-syn-frame.exp,v retrieving revision 1.6 diff -u -p -r1.6 mi-syn-frame.exp --- gdb.mi/mi-syn-frame.exp 4 Aug 2005 01:52:31 -0000 1.6 +++ gdb.mi/mi-syn-frame.exp 1 Sep 2005 22:10:47 -0000 @@ -35,8 +35,6 @@ if { [gdb_compile "${srcdir}/${subdir}/ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } -set my_mi_gdb_prompt "\\(gdb\\)\[ \]*\[\r\n\]*" - mi_gdb_exit mi_gdb_start separate-inferior-tty mi_delete_breakpoints @@ -61,9 +59,18 @@ mi_gdb_test "402-stack-list-frames" "402 # Continue back to main() # mi_gdb_test "403-exec-continue" \ - "403\\^running\[\r\n\]+${my_mi_gdb_prompt}403\\\*stopped" \ - "testing exec continue" \ - "hi in foo\[\r\n\]\+" + "403\\^running" \ + "testing exec continue" \ + "hi in foo\[\r\n\]\+" + +gdb_expect { + -re "403\\*stopped.*$mi_gdb_prompt$" { + pass "finished exec continue" + } + timeout { + fail "finished exec continue (timeout)" + } +} mi_gdb_test "404-stack-list-frames 0 0" \ "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\}.*\\\]" \ @@ -92,7 +99,16 @@ mi_gdb_test "407-stack-list-frames" \ mi_gdb_test "408-exec-continue" \ - "408\\^running\[\r\n\]+${my_mi_gdb_prompt}408\\\*stopped" + "408\\^running" + +gdb_expect { + -re "408\\*stopped.*$mi_gdb_prompt$" { + pass "finished exec continue" + } + timeout { + fail "finished exec continue (timeout)" + } +} mi_gdb_test "409-stack-list-frames 0 0" \ "409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\}.*\\\]" \