From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20077 invoked by alias); 5 Jan 2003 15:42:36 -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 20069 invoked from network); 5 Jan 2003 15:42:35 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by 209.249.29.67 with SMTP; 5 Jan 2003 15:42:35 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18VEnZ-0001uJ-00; Sun, 05 Jan 2003 11:42:57 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18VCv4-0000Mo-00; Sun, 05 Jan 2003 10:42:34 -0500 Date: Sun, 05 Jan 2003 15:42:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: gdb-patches@sources.redhat.com, Michael Elizabeth Chastain Subject: Re: RFC: gdb_test_multiple Message-ID: <20030105154234.GA1348@nevyn.them.org> Mail-Followup-To: Andrew Cagney , gdb-patches@sources.redhat.com, Michael Elizabeth Chastain References: <20030104201600.GA26779@nevyn.them.org> <3E18501D.8050601@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3E18501D.8050601@redhat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-01/txt/msg00179.txt.bz2 On Sun, Jan 05, 2003 at 10:32:45AM -0500, Andrew Cagney wrote: > >gdb_test_multiple "break Foo::Bar" "breakpoint on Foo::Bar" { > > -re "Breakpoint at .*\[\r\n\]$gdb_prompt $" { > > pass "$_gdb_message" > > } > > -re "Explode!" { > > fail "$_gdb_message (gdb/90210)" > > } > > -re "Bang." { > > kfail "gdb/90211" "$_gdb_message" > > } > >} > > Why not just use: > > set msg "breakpoint on Foo::Bar" > gdb_test_multiple "break Foo::Bar" { > ... fail "$msg ... > } > > I don't think the ``$_gdb_message'' is right. It certainly isn't > exactly intuative. No, it certainly isn't. The problem is that the other cases internally need to know the msg; the only way to do it as above would be to document a _required_ variable named $msg. This works, of course: set msg "breakpoint on Foo::Bar" gdb_test_multiple "break Foo::Bar" "breakpoint on Foo::Bar" { ... fail "$msg ... } I want to think about this a little more anyway; as Michael mentioned, I don't think it's recursion safe. I can't fix this syntax due to TCL limitations, so it might become: gdb_test_multiple "break Foo::Bar" "breakpoint on Foo::Bar" \ "Breakpoint at .*\[\r\n\]$gdb_prompt $" { pass $msg } \ "Bang." { kfail "gdb/90211" $msg } Which isn't so bad, after all. I had some reason not to do it that way but I can't remember what it was, now. What do you think of this change? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer