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