From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3732 invoked by alias); 5 Jan 2003 16:46:37 -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 3725 invoked from network); 5 Jan 2003 16:46:36 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by 209.249.29.67 with SMTP; 5 Jan 2003 16:46:36 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18VFnW-0001yZ-00; Sun, 05 Jan 2003 12:46:58 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18VDv2-0000bo-00; Sun, 05 Jan 2003 11:46:36 -0500 Date: Sun, 05 Jan 2003 16:46:00 -0000 From: Daniel Jacobowitz To: Michael Elizabeth Chastain Cc: ac131313@redhat.com, gdb-patches@sources.redhat.com Subject: Re: RFC: gdb_test_multiple Message-ID: <20030105164636.GA2269@nevyn.them.org> Mail-Followup-To: Michael Elizabeth Chastain , ac131313@redhat.com, gdb-patches@sources.redhat.com References: <200301051633.h05GX2C18873@duracef.shout.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200301051633.h05GX2C18873@duracef.shout.net> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-01/txt/msg00181.txt.bz2 On Sun, Jan 05, 2003 at 10:33:02AM -0600, Michael Elizabeth Chastain wrote: > Daniel Jacobowitz writes: > > set msg "breakpoint on Foo::Bar" > gdb_test_multiple "break Foo::Bar" "breakpoint on Foo::Bar" { > ... fail "$msg ... > } > > This can be improved to: > > set msg "breakpoint on Foo::Bar" > gdb_test_multiple "break Foo::Bar" $msg { > ... fail $msg ... > } > > The grammar would still allow different messages for the explicit > messages given by the caller versus the internal messages generated > by gdb_test_multiple. But the normal idiom would have one $msg. > > gdb_test_multiple "break Foo::Bar" "breakpoint on Foo::Bar" \ > "Breakpoint at .*\[\r\n\]$gdb_prompt $" { pass $msg } \ > "Bang." { kfail "gdb/90211" $msg } > > Err, I like my treatment of $msg better, I dislike subroutines that > create variables like this for little inferior blocks of code. > But maybe I have poor taste in TCL style. This isn't a style thing, though. Let me point out the actual syntactic difference between the two above: the strings are expanded/substituted at the time of the call to gdb_test_multiple instead of at the time of the actual expect {}, down the call chain. This means that I don't have to do the grossness with populating variables in the caller's namespace, which violates every bit of stylistic sense I've got left after yesterday. Could even arrange to run the { pass $foo } block in the caller's level, which is exactly as expected. I like the revised proposal much more :) What do you think of it? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer