From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16606 invoked by alias); 1 Sep 2005 00:52:29 -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 16466 invoked by uid 22791); 1 Sep 2005 00:52:22 -0000 Received: from eastrmmtao06.cox.net (HELO eastrmmtao06.cox.net) (68.230.240.33) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 01 Sep 2005 00:52:21 +0000 Received: from white ([68.9.64.121]) by eastrmmtao06.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20050901005218.WRCM18478.eastrmmtao06.cox.net@white>; Wed, 31 Aug 2005 20:52:18 -0400 Received: from bob by white with local (Exim 3.36 #1 (Debian)) id 1EAdJA-0001sl-00; Wed, 31 Aug 2005 20:52:00 -0400 Date: Thu, 01 Sep 2005 00:52:00 -0000 From: Bob Rossi To: Mark Kettenis , gdb-patches@sources.redhat.com Subject: Re: MI testsuite to use PTY for inferior Message-ID: <20050901005200.GA6990@white> Mail-Followup-To: Mark Kettenis , gdb-patches@sources.redhat.com References: <20050727031758.GA15798@white> <200508132151.j7DLpnoR015475@elgar.sibelius.xs4all.nl> <20050819222721.GA20029@white> <20050830025203.GA16646@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050830025203.GA16646@nevyn.them.org> User-Agent: Mutt/1.5.9i X-SW-Source: 2005-09/txt/msg00001.txt.bz2 On Mon, Aug 29, 2005 at 10:52:03PM -0400, Daniel Jacobowitz wrote: > On Fri, Aug 19, 2005 at 06:27:21PM -0400, Bob Rossi wrote: > > > Funny thing is that if I run mi-console.exp alone, it usually > > > (although not always) succeeds. > > > > > > Attached are a gdb.log for a failing run and a passing run. > > > > OK, I've tracked down why mi-console.exp breaks. Also, I can reproduce > > it. The problem is slightly difficult to fix because of race conditions > > so I was hoping to get some advice from people who might have had > > similar experience with the testsuite. > > Nice job tracking this down. Hi Daniel, The solution you sent in gave me an idea that might work out. It's pretty simple. First look at the patch with it's comment, Index: gdb/testsuite/ChangeLog + * lib/mi-support.exp (mi_gdb_test): Change -re to not be anchored. 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? Thanks, Bob Rossi