From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 361 invoked by alias); 31 Jul 2005 01:19:56 -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 354 invoked by uid 22791); 31 Jul 2005 01:19:52 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 31 Jul 2005 01:19:52 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1Dz2UZ-0003c1-3l; Sat, 30 Jul 2005 21:19:51 -0400 Date: Sun, 31 Jul 2005 01:19:00 -0000 From: Daniel Jacobowitz To: Nick Roberts Cc: gdb-patches@sources.redhat.com Subject: Re: MI testsuite to use PTY for inferior Message-ID: <20050731011951.GA13808@nevyn.them.org> Mail-Followup-To: Nick Roberts , gdb-patches@sources.redhat.com References: <17131.5769.342629.658975@farnswood.snap.net.nz> <20050730173855.GA21401@white> <20050730180819.GA6597@nevyn.them.org> <17131.65263.640986.862922@farnswood.snap.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17131.65263.640986.862922@farnswood.snap.net.nz> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-07/txt/msg00234.txt.bz2 On Sun, Jul 31, 2005 at 10:27:59AM +1200, Nick Roberts wrote: > That seems to imply that if IPATTERN is present, MESSAGE can't be omitted. Yes. If this bugs you, you could make a message of "" be handled like an omitted message. > How about: > > # mi_gdb_test COMMAND PATTERN-LIST [MESSAGE] > ... > # PATTERN-LIST is the list {PATTERN [IPATTERN]} where: > # PATTERN is the pattern to match for a PASS, and must NOT include > # the \r\n sequence immediately before the gdb prompt. > # IPATTERN is the pattern to match for the inferior's output. This will not > # produce a PASS if successfull, but will produce a FAIL if unsuccessful. > > if {[llength $PATTERN-LIST] == 1} { > ... > } elseif {[llength $PATTERN-LIST] == 2} { > ... > > This seems to be compatible with existing arguments as scalars seem to be > considered as lists of length 1. But perhaps you can't have lists within > argument lists in TCL. No, that won't work correctly. TCL quoting is funny. Look at this: % set a "a" a % llength $a 1 % set a "a b" a b % llength $a 2 It reparses the string, textually, as a list. Most patterns will be more than one "item". This would be easy in Python, but is a bit of a bear in TCL. -- Daniel Jacobowitz CodeSourcery, LLC