From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 413 invoked by alias); 31 Jan 2005 22:00:58 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 365 invoked from network); 31 Jan 2005 22:00:50 -0000 Received: from unknown (HELO lakermmtao06.cox.net) (68.230.240.33) by sourceware.org with SMTP; 31 Jan 2005 22:00:50 -0000 Received: from white ([68.9.64.121]) by lakermmtao06.cox.net (InterMail vM.6.01.04.00 201-2131-117-20041022) with ESMTP id <20050131220048.KGFG6774.lakermmtao06.cox.net@white> for ; Mon, 31 Jan 2005 17:00:48 -0500 Received: from bob by white with local (Exim 3.35 #1 (Debian)) id 1CvjbG-0002IM-00 for ; Mon, 31 Jan 2005 17:00:50 -0500 Date: Mon, 31 Jan 2005 22:00:00 -0000 From: Bob Rossi To: GDB Subject: Re: How do I get regexp from expect at gdb_expect? Message-ID: <20050131220050.GB8411@white> Mail-Followup-To: GDB References: <20050129025743.GA4053@white> <200501290309.j0T39F1i020834@tully.CS.Berkeley.EDU> <20050131150652.GA7955@white> <20050131162609.GA19459@nevyn.them.org> <20050131211042.GA8411@white> <20050131212122.GA10092@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050131212122.GA10092@nevyn.them.org> User-Agent: Mutt/1.3.28i X-SW-Source: 2005-01/txt/msg00169.txt.bz2 > > The next command, '200-break-list' is in both the 'expect_out(buffer)' > > and in the 'expect_out(0,string)'. This leads me to believe that there > > is something wrong with the regular expression matching. It can match > > things that it shouldn't, which could mask problems. > > > > I don't really understand what you are saying about 'GDB is echoing > > commands'. I do understand that when you are at the terminal running > > GDB, GDB allows the terminal to 'echo' the char's typed. However, if you > > fork/exec GDB, and send it a command, it will not 'echo' the data back > > to your process. Isn't this the way Expect works? > > Expect works on a terminal. It's not instrumenting GDB to find out > what GDB is writing; it's accepting whatever input comes to its side of > the terminal. Which includes things echoed by the terminal. In > readline mode GDB turns off echo and provides the echo manually; in MI > mode, it does not touch the terminal, which echoes by default. > > It's just your patterns that are producing a difference. OOOOOO, Thanks! I didn't realize Expect use's the terminal in this way, I think re-writing the mi_gdb_test regex from this, -re "\[\r\n\]*($pattern)\[\r\n\]+$mi_gdb_prompt\[ \]*$" { to this, -re "\[\r\n\]*$command(\[\r\n\]*(($pattern)\[\r\n\]+$mi_gdb_prompt\[ \]*$))" { solve's the problem! It also tighten's up the MI output command matching, I honestly don't know how the -break-delete was getting eaten in the regular expression, unless $pattern happened to have a .*. Oops, in that case, I guess we aren't really validation much, anything could have come out of GDB, and it probably would have passed. I'll consider adding this patch to the testsuite once I find the rest of the testcase's that make the MI output command syntax checker fail. Thanks, Bob Rossi