From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3744 invoked by alias); 29 Jan 2005 03:16:29 -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 3715 invoked from network); 29 Jan 2005 03:16:20 -0000 Received: from unknown (HELO lakermmtao12.cox.net) (68.230.240.27) by sourceware.org with SMTP; 29 Jan 2005 03:16:20 -0000 Received: from white ([68.9.64.121]) by lakermmtao12.cox.net (InterMail vM.6.01.04.00 201-2131-117-20041022) with ESMTP id <20050129031619.RXPV1656.lakermmtao12.cox.net@white>; Fri, 28 Jan 2005 22:16:19 -0500 Received: from bob by white with local (Exim 3.35 #1 (Debian)) id 1Cuj5x-00017y-00; Fri, 28 Jan 2005 22:16:21 -0500 Date: Sat, 29 Jan 2005 03:16:00 -0000 From: Bob Rossi To: Paul Hilfinger , GDB Subject: Re: How do I get regexp from expect at gdb_expect? Message-ID: <20050129031621.GC4053@white> Mail-Followup-To: Paul Hilfinger , GDB References: <20050129025743.GA4053@white> <200501290309.j0T39F1i020834@tully.CS.Berkeley.EDU> <20050129031113.GB4053@white> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050129031113.GB4053@white> User-Agent: Mutt/1.3.28i X-SW-Source: 2005-01/txt/msg00158.txt.bz2 On Fri, Jan 28, 2005 at 10:11:13PM -0500, Bob Rossi wrote: > On Fri, Jan 28, 2005 at 07:09:15PM -0800, Paul Hilfinger wrote: > > > > > Hi, > > > > > > I'm using expect with GDB and I've come across a problem. For instance, > > > say I have, > > > > > > gdb_expect $tmt { > > > -re "(Ending remote debugging.*$mi_gdb_prompt\[ \]*$)" { > > > # at this point, how do I get the string that matched the above > > > # regex? > > > } > > > } > > > } > > > > Here is some relevant documentation: > > > > Upon matching a pattern (or eof or full_buffer), any > > matching and previously unmatched output is saved in > > the variable expect_out(buffer) [as in $expect_out(buffer)]. > > Up to 9 regexp sub- > > string matches are saved in the variables > > expect_out(1,string) through expect_out(9,string). If > > the -indices flag is used before a pattern, the start- > > ing and ending indices (in a form suitable for lrange) > > of the 10 strings are stored in the variables > > expect_out(X,start) and expect_out(X,end) where X is a > > digit, corresponds to the substring position in the > > buffer. 0 refers to strings which matched the entire > > pattern... > > Thanks, I did see that, however, I think there is a problem because I'm > calling a Tcl function called 'gdb_expect', instead of expect. I don't > know how that change's the situation. Paul, thanks for the info, apparently this works even through the gdb_expect call. Bob Rossi