[Cygwin] Fix for: detaching crashes the inferior.

Pedro Alves pedro_alves@portugalmail.pt
Mon Apr 9 02:08:00 GMT 2007


Pedro Alves wrote:
> 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.
>>

Here is a new version.

The real reason for the crashes is that we should be setting
the context back to the inferior, as gdb's copy contains
an adjusted PC.  With win32_continue we would resume the
inferior at the wrong address.  win32_resume takes care of
that, so the simple fix is to use it when detaching.

The current code uses delete_command to remove breakpoints, but
that leaves the internal breakpoints behind - not something
we want.  Is there a case where we can get to to_detach
without remove_breakpoints being called?  I don't think there
is - we always get here through normal_stop, right?
If there isn't, I'll just remove the call to it I'm
introducing in the patch.

Cheers,
Pedro Alves



-------------- next part --------------
A non-text attachment was scrubbed...
Name: win32_detach.diff
Type: text/x-diff
Size: 998 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20070409/3140c7fa/attachment.bin>


More information about the Gdb-patches mailing list