Re: Keeping breakpoints inserted

Michael Snyder
2007-11-30T21:41:06Z

On Fri, 2007-11-30 at 19:03 -0200, Thiago Jung Bauermann wrote:
> Hi,
>
> On Thu, 2007-11-29 at 22:24 +0300, Vladimir Prus wrote:
> > Anybody has comments on this approach?
>
> When adding and removing breakpoints, will GDB stop all threads or just
> the one under inspection?
>
> On first thought, I think that if adding a breakpoint can be done
> atomically (i.e., trap instruction is 1 word wide), then it wouldn't be
> necessary to stop other threads. Am I being too naive here?

There will be some as-it-were non-deterministic behavior,
it seems to me. If threads are running while we are inserting
breakpoints, then there will (at some point) be breakpoint
events while we are inserting breakpoints, and the order of
these events (and of running-threads stopping) will depend
on the order in which we insert them, as well as on what
the running threads happen to be doing at the time.

I should think that this would be more intrusive (in the
sense of changing the behavior of the target program) than
we already are.

We could see a deadlock develop during the time it takes us
to insert all the breakpoints.