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

Michael Elizabeth Chastain
2003-01-03T17:07:27Z

My proposal for the behavior matrix is:

until:
continue until any source line > the current source line is reached,
in the current stack frame, or the current stack frame pops,
whichever comes first.

until LOCATION:
a. LOCATION is in current function: continue until $PC == LINE
in the current stack frame, or the current stack frame pops,
whichever comes first.
b. LOCATION not in current function: error

In the 'until LOCATION' case, I guess it's okay for the user to be on
line 70 and ask to continue 'until line 65'. The user is expecting
the program to get to line 65 and they are probably right.

I don't want to say "for every command line, choose some behavior and
implement it". That leads to a bunch of quirky non-orthogonal commands.
I want to say "for everything we can imagine the user doing,
provide one simple way to do it." In Elena's matrix:

until funcname:
d. funcname called from current frame (2) --> continue until func is reached
e. funcname not called from current frame --> cont until current frame pops.

There is already a way to do almost exactly this in gdb:

tbreak funcname
finish

If we had a user-accessible 'mbreak' command for momentary breakpoints,
then this would be identical:

mbreak funcname
finish

Judging by the November thread, most people really want to have
'until LOCATION' always do something, even when LOCATION is not in
the current frame. I really think it should give an error
in that case.

Michael C