This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [Cygwin] Fix for: detaching crashes the inferior.
Pedro Alves wrote:
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.
Here is the updated patch that removes the call to delete_command.
OK?
Cheers,
Pedro Alves
2007-04-10 Pedro Alves <pedro_alves@portugalmail.pt>
* win32-nat.c (win32_detach): Remove delete_command call.
Resume inferior with win32_resume instead of win32_continue.
---
gdb/win32-nat.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: src/gdb/win32-nat.c
===================================================================
--- src.orig/gdb/win32-nat.c 2007-04-08 12:11:22.000000000 +0100
+++ src/gdb/win32-nat.c 2007-04-10 21:31:02.000000000 +0100
@@ -1775,8 +1775,9 @@ win32_detach (char *args, int from_tty)
if (has_detach_ability ())
{
- delete_command (NULL, 0);
- win32_continue (DBG_CONTINUE, -1);
+ ptid_t ptid = {-1};
+ win32_resume (ptid, 0, TARGET_SIGNAL_0);
+
if (!DebugActiveProcessStop (current_event.dwProcessId))
{
error (_("Can't detach process %lu (error %lu)"),