> > > Can the "ignore next N hits of breakpoint" count be reset when you
> > > rerun the program with r ? Currently the number is kept, which is confusing
> > > when N is too large and a core dump happens before N is reached.
> >
> > Can you describe exactly the behavior that you want? For example, the
> > following sequence of commands should certainly work as expected:
> >
> > (gdb) run
> >
> > ... look around
> > ... decide we want to stop at the 16th hit of breakpoint 2
> >
> > (gdb) ignore 2 15
> > (gdb) run
> >
>
> Ah, I do this
>
> (gdb) breakpoint X
> (gdb) run
>
> ...
>
> breakpoint X
> (gdb) c 1000
> SIGSEGV
>
> (gdb) info b
> breakpoint X hit 20 times
> ignore next 980 hits
>
> the I know that to do
>
> c 19
>
> whenever I hit X after starting; when I 'm debugging, I rerun the
> program often, and I prefer to start afresh every time I do.
I see what you mean. But why not say "ig X 19" after you
get the results from "info b", and then "run"?
I think the problem is that for "continue" to take an ignore count is
simply a confusing interface. The most natural interpretation is
"continue, and ignore the next N hits of this breakpoint." One
expects that ignore count to only apply to that "continue" command, or
to have some sort of limited scope, but it doesn't.
> > I definitely don't think we should just clear all the ignore counts
> > when we run. But perhaps there is some other logic which would make
> > more sense.
>
> I'd be just as happy with a variable option (defaulting to off) that
> does this.
Variable options are not really a good solution to problems like this.
Over time, you end up with a zillion of them. They're usually just a
consequence of making poor choices earlier.