Re: Keeping breakpoints inserted

Jim Blandy
2007-12-01T17:52:51Z

On Nov 30, 2007 5:30 PM, Michael Snyder <msnyder@specifix.com> wrote:
> > Since breakpoints only make the threads that hit them execute "very
> > slowly", I don't see how they could introduce a deadlock in code that
> > didn't already have the potential for deadlock in the absence of a
> > debugger.
>
> Well, just 'cause you've changed the timing. Thread A holds
> a resource that thread B needs; thread A hits a breakpoint
> but thread B gets to keep running (for a while) because you
> haven't finished inserting breakpoints.

Non-stop debugging can affect the relative timing of threads more than
all-stop debugging. And even if the developer only stops one thread,
others may stop too, because they're waiting for the developer's
thread to do something. But I don't think what you've described is
deadlock: B is blocked waiting for A, which may take a long time
(until the developer lets go of it, to be exact) to get through what
it's doing. When A resumes, both will resume.

The original concern you raised was that non-stop debugging is "more
intrusive than we already are". But clearly all-stop debugging on a
live system is maximally intrusive to the system's users; non-stop
debugging has the potential to be much less intrusive, when used with
knowledge of the interactions between the system's threads.

I think what's bothering you is that the degree of effective
interference depends on the developer knowing stuff about the system
under debug; it's not just a flat-out guarantee made by the debugger:
"no matter what you do, we promise X, or at least roughly X." But
there are reasonable debugger use cases that are simply not possible
at all with all-stop debugging. We want to support those, in addition
to the ones we support now.