Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: Elena Zannoni <ezannoni@redhat.com>
Cc: Daniel Jacobowitz <drow@mvista.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFA/PATCH] breakpoint.c: fix until command
Date: Thu, 02 Jan 2003 20:29:00 -0000	[thread overview]
Message-ID: <3E14A106.C782313C@redhat.com> (raw)
In-Reply-To: <15892.39816.673541.982034@localhost.redhat.com>

Elena Zannoni wrote:
> 
> 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?

The former.  That's how it's always been intended to behave.
Otherwise we wouldn't be saving the frame.

> I would find the latter more intuitive. 
> To do what you want one could use 'break 99' and 'ignore n'.

Only if you were confident that you knew the value of 'n'.

Anyway, I'm not advocating which way is more intuitive, 
I'm just reporting how it is currently meant to behave.
Always been that way, AFAIK.

 
> (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  <ezannoni@redhat.com>
>  > > > >
>  > > > >         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


  reply	other threads:[~2003-01-02 20:29 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-20 10:19 Elena Zannoni
2002-12-23 15:55 ` Michael Snyder
2002-12-23 16:13   ` Daniel Jacobowitz
2002-12-23 16:59     ` Michael Snyder
2002-12-23 19:23       ` Daniel Jacobowitz
2003-01-02 20:25         ` Michael Snyder
2003-01-02 20:34           ` Elena Zannoni
2003-01-02 20:40             ` Michael Snyder
2003-01-03  0:12             ` Elena Zannoni
2003-01-03  1:44               ` Michael Snyder
2003-01-03  1:50                 ` Daniel Jacobowitz
2003-01-03  2:37                   ` Michael Snyder
2003-01-03 14:29                     ` Elena Zannoni
2003-01-03 23:51                       ` Michael Snyder
2003-01-03 23:53                         ` Elena Zannoni
2003-01-04  0:05                           ` Michael Snyder
2003-01-04  1:54                             ` Daniel Jacobowitz
2003-01-06 22:06                               ` Elena Zannoni
2003-01-07  1:27                                 ` Michael Snyder
2003-01-07  1:45                                   ` Elena Zannoni
2003-01-07  2:09                                     ` Michael Snyder
2003-01-07  4:31                                       ` Daniel Jacobowitz
2003-01-08 22:08                                         ` Elena Zannoni
2003-01-09  1:52                                           ` Daniel Jacobowitz
2003-01-10 22:25                                             ` Elena Zannoni
2003-01-10 22:28                                               ` Daniel Jacobowitz
2003-01-10 23:20                                                 ` Elena Zannoni
2003-01-03 14:15                   ` Elena Zannoni
2003-01-03 23:31                     ` Michael Snyder
2003-01-03 23:51                       ` Elena Zannoni
2003-01-03 23:58                         ` Michael Snyder
2003-01-03 14:13                 ` Elena Zannoni
2003-01-03 23:28                   ` Michael Snyder
2003-01-02 20:01       ` Elena Zannoni
2003-01-02 20:29         ` Michael Snyder [this message]
2003-01-03  4:15 Michael Elizabeth Chastain
2003-01-03  4:59 ` Daniel Jacobowitz
2003-01-03 21:52   ` Michael Snyder
2003-01-03 21:54     ` Daniel Jacobowitz
2003-01-03 22:39       ` Elena Zannoni
2003-01-03 23:09         ` Michael Snyder
2003-01-03 14:43 ` Elena Zannoni
2003-01-03 22:06   ` Michael Snyder
2003-01-03 22:43     ` Elena Zannoni
2003-01-03 23:13       ` Michael Snyder
2003-01-03  6:49 Michael Elizabeth Chastain
2003-01-03 15:17 ` Daniel Jacobowitz
2003-01-03 16:38 Michael Elizabeth Chastain
2003-01-03 16:57 ` Daniel Jacobowitz
2003-01-03 16:48 Michael Elizabeth Chastain
2003-01-03 23:33 ` Michael Snyder
2003-01-03 17:07 Michael Elizabeth Chastain
2003-01-03 17:51 ` Elena Zannoni
2003-01-03 17:40 Michael Elizabeth Chastain
2003-01-03 18:03 Michael Elizabeth Chastain
2003-01-04  0:37 Michael Elizabeth Chastain
2003-01-05 17:02 ` Andrew Cagney
2003-01-07  1:30   ` Michael Snyder
2003-01-07  3:53 Michael Elizabeth Chastain
2003-01-07  4:05 Michael Elizabeth Chastain
2003-01-11  1:04 Michael Elizabeth Chastain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E14A106.C782313C@redhat.com \
    --to=msnyder@redhat.com \
    --cc=drow@mvista.com \
    --cc=ezannoni@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox