Temporary breakpoints

Jim Blandy jimb@cygnus.com
Mon Aug 16 22:24:00 GMT 1999

> >GDB does not report a breakpoint hit if it occurs exactly when GDB
> >would have stopped stepping anyway.  So, if you set a breakpoint on
> >the first instruction of a line, and "step" to it, GDB won't report a
> >hit, because it would have stopped there anyway.  If you set a
> >breakpoint on an instruction in the middle of the line, GDB will
> >report it, because you've stopped in an unusual place.  But if you
> >stepi, then GDB will never report a breakpoint hit.
> But I think that's not the way it should work.  If I set a breakpoint, then
> step over it, I want the breakpoint to be hit.  I want it to print what it
> would normally print, or count if it's a multiple proceed, or execute
> special commands if they are defined.  I see a breakpoint as a temporary
> patch to my program, and I want single step to honor that patch (as
> a unit).

I think it's a matter of opinion.  The behavior you describe is the
behavior I'd want if I were writing code that used it (which is
consistent with your view of a breakpoint as a patch), but not what I
want as a human being trying to watch my program run (I already knew I
was going to stop there).

More information about the Gdb mailing list