From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23606 invoked by alias); 30 Jul 2005 22:47:46 -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 23581 invoked by uid 22791); 30 Jul 2005 22:47:43 -0000 Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sat, 30 Jul 2005 22:47:43 +0000 Received: from farnswood.snap.net.nz (p221-tnt1.snap.net.nz [202.124.110.221]) by viper.snap.net.nz (Postfix) with ESMTP id 7A1D35F5678; Sun, 31 Jul 2005 10:47:40 +1200 (NZST) Received: by farnswood.snap.net.nz (Postfix, from userid 501) id 4635162A9A; Sat, 30 Jul 2005 23:28:00 +0100 (BST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17131.65263.640986.862922@farnswood.snap.net.nz> Date: Sat, 30 Jul 2005 22:47:00 -0000 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: MI testsuite to use PTY for inferior In-Reply-To: <20050730180819.GA6597@nevyn.them.org> References: <17131.5769.342629.658975@farnswood.snap.net.nz> <20050730173855.GA21401@white> <20050730180819.GA6597@nevyn.them.org> X-SW-Source: 2005-07/txt/msg00232.txt.bz2 > > > With these arguments, you can't discriminate between > > > > > > mi_gdb_test COMMAND PATTERN MESSAGE > > > > > > and > > > > > > mi_gdb_test COMMAND PATTERN IPATTERN > > > > > > (MESSAGE is optional). > > > > Yeah, this does look like a problem. Thanks. Is there a good way to work > > around this in TCL? Or should I make the IPATTERN parameter necessary? > > Force the user to put "" for IPATTERN? > > > > Or rather, should I make the MESSAGE parameter necessary? I have a feeling > > that all of the MI tests use the MESSAGE parameter. If I do that, I can > > make the IPATTERN parameter optional, and last. > > You're adding a new parameter; having it optional is fine, as long as > you add it after all existing optional parameters. COMMAND PATTERN > IPATTERN MESSAGE is more intuitive, but I think that's less important > than correctness, so I would recommend COMMAND PATTERN [MESSAGE > [IPATTERN]]. Make sense? That seems to imply that if IPATTERN is present, MESSAGE can't be omitted. 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. Nick