From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18643 invoked by alias); 2 Jan 2003 20:01:23 -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 18593 invoked from network); 2 Jan 2003 20:01:21 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by 209.249.29.67 with SMTP; 2 Jan 2003 20:01:21 -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 h02JXsB20235 for ; Thu, 2 Jan 2003 14:33: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 h02K19a03272; Thu, 2 Jan 2003 15:01:10 -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 h02K15L13090; Thu, 2 Jan 2003 15:01:06 -0500 Received: by localhost.redhat.com (Postfix, from userid 469) id D5202FF78; Thu, 2 Jan 2003 15:05:28 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15892.39816.673541.982034@localhost.redhat.com> Date: Thu, 02 Jan 2003 20:01:00 -0000 To: Michael Snyder Cc: Daniel Jacobowitz , Elena Zannoni , gdb-patches@sources.redhat.com Subject: Re: [RFA/PATCH] breakpoint.c: fix until command In-Reply-To: <3E07B0DC.CC733B10@redhat.com> References: <15875.24035.153991.390184@localhost.redhat.com> <3E07A1F2.E7B77C89@redhat.com> <20021224000211.GA8155@nevyn.them.org> <3E07B0DC.CC733B10@redhat.com> X-SW-Source: 2003-01/txt/msg00018.txt.bz2 Michael Snyder writes: > Daniel Jacobowitz wrote: > > > > On Mon, Dec 23, 2002 at 03:53:22PM -0800, Michael Snyder wrote: > > > Elena Zannoni wrote: > > > > > > > > This fixes the problem reported in: > > > > http://sources.redhat.com/ml/gdb/2002-11/msg00144.html > > > > > > > > testsuite patch coming > > > > > > Elena, can you sum up in a sentence or two, what this change > > > is intended to do? > > > > [Since I happen to be reading email right now, I'll do a sketchy > > imitation.] > > > > The problem is that we were marking the breakpoint on the > > user-specified line with the current frame. But when we hit that > > breakpoint, if it's in a different function, it will have a different > > frame. Right now we see that the frames don't match and resume > > executing. > > > > Oops. > > OK, thanks. But we _need_ to mark the breakpoint with the current > frame, because if the breakpoint is in the current frame, we don't > want to stop in an inner recursive call, ie. not until the current > frame hits the breakpoint. > You mean this: (gdb) l 91 #else 92 int factorial (value) 93 int value; 94 #endif 95 { 96 if (value > 1) { 97 value *= factorial (value - 1); 98 } 99 return (value); 100 } (gdb) until 99 where should we stop? At the same invocation of factorial from which we issued the until, or the next time line 99 is executed, i.e. the next inner invocation of factorial? I would find the latter more intuitive. To do what you want one could use 'break 99' and 'ignore n'. (gdb) b factorial Breakpoint 2 at 0x80485d7: file /home/ezannoni/sources/src/gdb/testsuite/gdb.base/break.c, line 96. (gdb) r The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /home/ezannoni/sources/native/gdb/testsuite/gdb.base/break Breakpoint 2, factorial (value=6) at /home/ezannoni/sources/src/gdb/testsuite/gdb.base/break.c:96 96 if (value > 1) { (gdb) delete Delete all breakpoints? (y or n) y (gdb) b 99 Breakpoint 3 at 0x80485f8: file /home/ezannoni/sources/src/gdb/testsuite/gdb.base/break.c, line 99. (gdb) ignore 3 5 Will ignore next 5 crossings of breakpoint 3. (gdb) c Continuing. Breakpoint 3, factorial (value=720) at /home/ezannoni/sources/src/gdb/testsuite/gdb.base/break.c:99 99 return (value); And here you are at the outermost invocation of factorial: (gdb) n 100 } (gdb) 720 main (argc=1, argv=0xbffff374, envp=0xbffff37c) at /home/ezannoni/sources/src/gdb/testsuite/gdb.base/break.c:81 81 marker1 (); Elena > So this needs further consideration, and I don't think it can > be approved as is. > > Michael > > > > > > > > 2002-12-20 Elena Zannoni > > > > > > > > Fix PR breakpoints/898. > > > > * breakpoint.c (until_break_command): Don't use selected_frame, > > > > but the null frame. > > > > > > > > Index: breakpoint.c > > > > =================================================================== > > > > RCS file: /cvs/uberbaum/gdb/breakpoint.c,v > > > > retrieving revision 1.104 > > > > diff -u -p -r1.104 breakpoint.c > > > > --- breakpoint.c 17 Dec 2002 17:27:44 -0000 1.104 > > > > +++ breakpoint.c 20 Dec 2002 18:06:27 -0000 > > > > @@ -5615,9 +5615,7 @@ until_break_command (char *arg, int from > > > > > > > > resolve_sal_pc (&sal); > > > > > > > > - breakpoint = > > > > - set_momentary_breakpoint (sal,get_frame_id (deprecated_selected_frame), > > > > - bp_until); > > > > + breakpoint = set_momentary_breakpoint (sal, null_frame_id, bp_until); > > > > > > > > if (!event_loop_p || !target_can_async_p ()) > > > > old_chain = make_cleanup_delete_breakpoint (breakpoint); > > > > > > > -- > > Daniel Jacobowitz > > MontaVista Software Debian GNU/Linux Developer