From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23212 invoked by alias); 13 Nov 2002 20:34:08 -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 23205 invoked from network); 13 Nov 2002 20:34:07 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 13 Nov 2002 20:34:07 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id gADKAsw16885 for ; Wed, 13 Nov 2002 15:10:54 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gADKY7D18888 for ; Wed, 13 Nov 2002 15:34:07 -0500 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gADKWjq32285; Wed, 13 Nov 2002 15:34:05 -0500 Received: by localhost.redhat.com (Postfix, from userid 469) id B4CFFFF79; Wed, 13 Nov 2002 15:27:15 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15826.46499.588754.946779@localhost.redhat.com> Date: Wed, 13 Nov 2002 12:34:00 -0000 To: Daniel Jacobowitz Cc: Elena Zannoni , gdb@sources.redhat.com Subject: Re: Behavior of 'until' command In-Reply-To: <20021113193458.GA31982@nevyn.them.org> References: <15826.42439.877628.972525@localhost.redhat.com> <20021113193458.GA31982@nevyn.them.org> X-SW-Source: 2002-11/txt/msg00148.txt.bz2 Daniel Jacobowitz writes: > On Wed, Nov 13, 2002 at 02:19:35PM -0500, Elena Zannoni wrote: > > > > The documenation says that 'until' does this: > > > > "@item until > > Continue running until a source line past the current line, in the > > current stack frame, is reached. [...]@code{until} always stops your > > program if it attempts to exit the current stack frame. > > [...] > > > > @item until @var{location} > > Continue running your program until either the specified location is > > reached, or the current stack frame returns. @var{location} is any of > > the forms of argument acceptable to @code{break}. This form of the > > command uses breakpoints, and hence is quicker than @code{until} > > without an argument." > > > > Note the 'will not exit the current stak frame' business. > > > > However, nobody forbids you from saying "until foo" (since that's an > > OK argument for break as well). And foo can be any function, called > > by the current frame or not. > > > > It is not clear to me what the doco describes as gdb's > > behavior. Concrete example below: > > > > 1 static int x; > > 2 > > 3 int fun () > > 4 { > > 5 x = 1; > > 6 } > > 7 > > 8 int fun2 () > > 9 { > > 10 x = 4; > > 11 } > > 12 > > 13 void foo() > > 14 { > > 15 x = x + 5; > > 16 fun2 (); > > 17 } > > 18 int main (int ac, char **av) > > 19 { > > 20 x = 3; > > 21 foo (); > > 22 fun (); > > 23 x = 3; > > 24 return 0; > > 25 } > > > > > > If I am in 'foo' at line 15,and enter the command 'until fun', I > > would expect to end up ... where? At line 22? Or should I end up at > > line 5? Right now gdb ends up at 22, i.e. doesn't enter 'fun'. I think > > it is consistent with the doco. > > > > Similarly from foo line 15 where should 'until fun2' take me? Inside > > fun2, at line 10? Or at line 16? Currently I end up at line 22 which > > is in main. This seems clearly wrong either way. > > > > Any thoughts? > > Your reading sounds right to me. If you look at the output of 'set > debug target 1' in your example, we set and hit the breakpoint in fun2 > and then decide to continue for some reason - that's got to be a bug. So do you agree that 'until fun2' should stop inside fun2, just like "break fun2;continue" would? If so I have a fix. > > If you have a chance this would make a great testcase. > yes, this testcase is not in the testsuite. Elena > -- > Daniel Jacobowitz > MontaVista Software Debian GNU/Linux Developer