Getting pissed off by gdb. Please help with stepping in.

Doug Evans dje@google.com
Thu Mar 18 15:40:00 GMT 2010


On Thu, Mar 18, 2010 at 6:33 AM, Daniel Jacobowitz <dan@codesourcery.com> wrote:
> here's the previous block:
>
>  if ((stop_pc == stop_pc_sal.pc)
>      && (ecs->event_thread->current_line != stop_pc_sal.line
>          || ecs->event_thread->current_symtab != stop_pc_sal.symtab))
>    {
>      /* We are at the start of a different line.  So stop.  Note that
>         we don't stop if we step into the middle of a different line.
>         That is said to make things like for (;;) statements work
>         better.  */
>
> IOW, if we are at a line boundary, we stop stepping.  If we've ended
> up in the middle of a line, we keep going.  This prevents us from
> ending up in a weird state where we show the line containing the
> function call, but the function has already been called.  I think it'd
> be even more confusing.
>
> This is a difference between stepping out of a function and finishing.

I realize one can *have* that difference.
However, I've rarely (if ever) *wanted* that difference.
But that's just *my* preference, YMMV :-).



More information about the Gdb mailing list