This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] fork in multi-threaded apps, per-thread pending_fork, other follow-fork cleanups.


On Monday 08 June 2009 15:21:54, Joel Brobecker wrote:
> > So, what to do?  One way to go about this, is to detect that
> > the user switched threads, since the fork event was reported, follow
> > the child, and refuse to resume it, leaving up to the user to
> > decide what to do with it:
> 
> FWIW, I'm a little late in answering, but the behavior seems reasonable
> to me.  I'd personally hate the debugger switching threads from under me
> without giving me the option of canceling my operation.
> 
> >  warning: Not resuming: switched threads before following fork child.
> >  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> I do find the message a little terse as to what is going on, and why
> the resume was aborted. I wonder if we can be a little more explicit?

There's always room for improvement.  :-)

> Is there a way for the user to determine which thread to switch back
> to in order to be able to resume?

It's too late for that, the fork has already been followed by then.  I
thought that forcing the user to select the forking thread before
resuming wouldn't be a nice experience (and considering an IDE, may be
awkward), but I may be wrong, and can be convinced otherwise.  If you
think that's preferred, we can tweak it.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]