This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA/PATCH] breakpoint.c: fix until command
Michael Snyder writes:
> > > > > I don't think there is a way to have both behaviors work correctly. I
> > > > > thought of checking that the pc which you want to run until is in
> > > > > the same function as the one of the selected frame, and in that case
> > > > > enforce the check (by using a non-null frame for the bp_until),
> > > > > otherwise use the null frame (which disables the check). But what would
> > > > > be the correct behavior if you say:
> > > > >
> > > > > "until bar" where bar is recursive, and you are in "bar" at the
> > > > > moment? This doesn't work currently. It seems intuitive that you
> > > > > would stop the next time you enter "bar". Right now you end up at the
> > > > > caller of "bar".
> > > > >
>
> I agree, but maybe we can distinguish between "a location inside the
> current function" and "a location outside the current function".
> After all, a line is not a meaningful distinction -- it could be a
> line inside another function.
>
> So I suggest using find_pc_partial_function to find the bounds
> of the current function. If <location> is inside, we use a
> frame-relative breakpoint. If it's outside, we don't.
>
> Wouldn't that satisfy the issue that you're working on?
See the above, in this very same thread. :-) I tried this yesterday,
but I ran into a corner case. If we decide what to do in this corner
case, we should be ok.
Elena
>
> Michael