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: [Cygwin] Fix for: detaching crashes the inferior.


Pedro Alves wrote:
Hi all,

Detaching on Cygwin often crashes the inferior, either
when gdb attaches to the inferior, or when gdb launches
the inferior as a child.

Initially I thought that somehow the FLAGS_TRACE_BIT
would be set in the context, and after detaching there would
be no debugger to catch the exception, but it turns out that
it isn't the case - I couldn't find a case where FLAGS_TRACE_BIT
was set.  But, surprisingly doing a SetThreadContext with
CONTEXT_CONTROL makes the crashes go away - even if you don't
change the contents of the context.  I'm not 100% sure why, but,
it fixes it.  If MSFT sends me the Windows sources, I'll look
deeper :)

I'm seeing something I missed. There may be a more correct fix. Ignore this patch for now.

Cheers,
Pedro Alves



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