This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Keeping breakpoints inserted
- From: "Jim Blandy" <jimb at red-bean dot com>
- To: "Michael Snyder" <msnyder at specifix dot com>
- Cc: "Jim Blandy" <jimb at codesourcery dot com>, "Thiago Jung Bauermann" <bauerman at br dot ibm dot com>, "Vladimir Prus" <vladimir at codesourcery dot com>, gdb at sources dot redhat dot com
- Date: Sat, 1 Dec 2007 09:52:42 -0800
- Subject: Re: Keeping breakpoints inserted
- References: <200711292224.23659.vladimir@codesourcery.com> <1196456622.6746.169.camel@localhost.localdomain> <1196458063.2501.153.camel@localhost.localdomain> <m363zjuvi2.fsf@codesourcery.com> <1196472622.2501.180.camel@localhost.localdomain>
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.