Re: [RFA/PATCH] breakpoint.c: fix until command

Daniel Jacobowitz
2003-01-09T01:52:58Z

On Wed, Jan 08, 2003 at 05:12:50PM -0500, Elena Zannoni wrote:
> Daniel Jacobowitz writes:
> > > > > > > I'd be happier if those two behaviors had different names, but the
> > > > > > > logical name I'd give to both of them is "until", so I guess we'll just
> > > > > > > have to live with this. (3) is meaningful when inside the function
> > > > > > > too, and with this scheme there's no way to express that without using
> > > > > > > breakpoints; but I think that's a small loss.
> > > > > > >
> > > > > >
> > > > > > Actually I start to believe that we need 2 separate commands. One
> > > > > > would do the current behavior the other would be w/o frame check. We
> > > > > > already have 'jump' (and it means something different). Maybe 'goto'?
> > > > > > I can't think of a decent name. 'reach', 'get to'?
> > > > >
> > > > > run-to?
> > > > > I like the idea of restricting "until" to the current function,
> > > > > and using a separate command for locations outside the current function.
> > > > > (or inside, if you want the effect of a temporary breakpoint).
> > > > > This would remove the ambiguity.
> > > >
> > > > I think that if we can find a decent name, there is more agreement
> > > > towards separating the behaviors. Except that 'run' in gdb means start
> > > > from the beginning, so runto can be ambiguous (it is also used in the
> > > > testsuite a lot with the meaning of start over).
> > >
> > > Ah, that's right. I was thinking of that usage, but I forgot
> > > that it starts from the beginning.
> > >
> > > Doesn't the testsuite also have a similar command that means
> > > "set a breakpoint here and continue till you get there"?
> >
> > Yes, it's gdb_continue_to_breakpoint, but it's not quite the same.
> >
> > I asked my official layperson for ideas on what to call this, and got
> > back:
> > "until first foo.c:40"
> > "until current foo.c:40"
> >
> > With a little massaging, how about one of:
> > "until first <line>"
> > "until-first <line>"
> > "until -first <line>"
> > ?
> >
> > Me, I'm partial to the third form; then you can have:
> > until -first func
> > until -current func
> >
>
> I am not clear what first vs. current means. You mean first as 'first
> time you cross' that given location? So you would drop the "called
> from the current frame" restriction.

Yeah, that was my basic idea.

> > And make one of those the default. But this is risks starting the
> > argument about syntax of options to CLI commands all over again. It
> > seems to me that these are both logical things to do for "until", so
> > why not call them both "until", if we can agree on a syntax?
> >
>
> I don't much like having options, it's too much to type. :-) I think
> we should leave the until as it is, name and all. Or it will confuse
> people even more. I like 'to' as a possible simple name for the other
> form. Or 'through'.

The problem is, neither to or through makes sense to me as an option; I
can't figure out what it will do.

--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer