aboutsummaryrefslogtreecommitdiff
path: root/gdb/win32-nat.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1998-01-19 18:38:51 +0000
committerIan Lance Taylor <ian@airs.com>1998-01-19 18:38:51 +0000
commitb5edcb4521a8ebe0af5f19a8a8564a9f602eba2d (patch)
treefc3e0f1e65cdbd62d532d870477b8d3958d3b434 /gdb/win32-nat.c
parent76bf91921d2ead8d868782f3485a5c1c1461c959 (diff)
downloadgdb-b5edcb4521a8ebe0af5f19a8a8564a9f602eba2d.zip
gdb-b5edcb4521a8ebe0af5f19a8a8564a9f602eba2d.tar.gz
gdb-b5edcb4521a8ebe0af5f19a8a8564a9f602eba2d.tar.bz2
From cgf@bbc.com (Chris Faylor):
* win32-nat.c (child_mourn_inferior): Call ContinueDebugEvent to let the child exit. (child_kill_inferior): Respond to all debug events as the child is terminating.
Diffstat (limited to 'gdb/win32-nat.c')
-rw-r--r--gdb/win32-nat.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c
index 664d554..be83b7a 100644
--- a/gdb/win32-nat.c
+++ b/gdb/win32-nat.c
@@ -1,5 +1,5 @@
/* Target-vector operations for controlling win32 child processes, for GDB.
- Copyright 1995, 1996 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB.
@@ -768,6 +768,9 @@ child_create_inferior (exec_file, allargs, env)
static void
child_mourn_inferior ()
{
+ (void) ContinueDebugEvent (current_process_id,
+ current_thread_id,
+ DBG_CONTINUE);
unpush_target (&child_ops);
generic_mourn_inferior ();
}
@@ -808,6 +811,22 @@ void
child_kill_inferior (void)
{
CHECK (TerminateProcess (current_process, 0));
+
+ for (;;)
+ {
+ DEBUG_EVENT event;
+ if (!ContinueDebugEvent (current_process_id,
+ current_thread_id,
+ DBG_CONTINUE))
+ break;
+ if (!WaitForDebugEvent (&event, INFINITE))
+ break;
+ current_thread_id = event.dwThreadId;
+ current_process_id = event.dwProcessId;
+ if (event.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT)
+ break;
+ }
+
CHECK (CloseHandle (current_process));
CHECK (CloseHandle (current_thread));
target_mourn_inferior(); /* or just child_mourn_inferior? */