diff options
author | Christopher Faylor <me+cygwin@cgf.cx> | 2001-10-11 01:55:58 +0000 |
---|---|---|
committer | Christopher Faylor <me+cygwin@cgf.cx> | 2001-10-11 01:55:58 +0000 |
commit | 700b351bda2ac5430482a63fa1efd2f68540a4df (patch) | |
tree | 494fe40824f7abe800d68ac87271b567be765b17 /gdb | |
parent | b58266b5a917aaf661188b8386cb0613a5703726 (diff) | |
download | binutils-gdb-700b351bda2ac5430482a63fa1efd2f68540a4df.tar.gz |
* win32-nat.c (get_child_debug_event): Close file handles created after process
creation and DLL load.
(child_create_inferior): Close unneeded process/thread handle after thread
creation.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/win32-nat.c | 4 | ||||
-rw-r--r-- | gdb/windows-nat.c | 4 |
3 files changed, 15 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7e52cf54794..cb151d0931c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2001-10-10 Christopher Faylor <cgf@redhat.com> + + * win32-nat.c (get_child_debug_event): Close file handles created after + process creation and DLL load. + (child_create_inferior): Close unneeded process/thread handle after + thread creation. + 2001-10-10 Jim Blandy <jimb@redhat.com> * mn10300-tdep.c (mn10300_analyze_prologue): Doc fixes. diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index 4113f2c69f6..83749b12945 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -868,6 +868,7 @@ get_child_debug_event (int pid ATTRIBUTE_UNUSED, struct target_waitstatus *ourst (unsigned) current_event.dwProcessId, (unsigned) current_event.dwThreadId, "CREATE_PROCESS_DEBUG_EVENT")); + CloseHandle (current_event.u.CreateProcessInfo.hFile); current_process_handle = current_event.u.CreateProcessInfo.hProcess; main_thread_id = current_event.dwThreadId; @@ -897,6 +898,7 @@ get_child_debug_event (int pid ATTRIBUTE_UNUSED, struct target_waitstatus *ourst (unsigned) current_event.dwProcessId, (unsigned) current_event.dwThreadId, "LOAD_DLL_DEBUG_EVENT")); + CloseHandle (current_event.u.LoadDll.hFile); catch_errors (handle_load_dll, NULL, (char *) "", RETURN_MASK_ALL); registers_changed (); /* mark all regs invalid */ ourstatus->kind = TARGET_WAITKIND_LOADED; @@ -1207,6 +1209,8 @@ child_create_inferior (char *exec_file, char *allargs, char **env) if (!ret) error ("Error creating process %s, (error %d)\n", exec_file, GetLastError ()); + CloseHandle (pi.hThread); + CloseHandle (pi.hProcess); do_initial_child_stuff (pi.dwProcessId); /* child_continue (DBG_CONTINUE, -1); */ diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 4113f2c69f6..83749b12945 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -868,6 +868,7 @@ get_child_debug_event (int pid ATTRIBUTE_UNUSED, struct target_waitstatus *ourst (unsigned) current_event.dwProcessId, (unsigned) current_event.dwThreadId, "CREATE_PROCESS_DEBUG_EVENT")); + CloseHandle (current_event.u.CreateProcessInfo.hFile); current_process_handle = current_event.u.CreateProcessInfo.hProcess; main_thread_id = current_event.dwThreadId; @@ -897,6 +898,7 @@ get_child_debug_event (int pid ATTRIBUTE_UNUSED, struct target_waitstatus *ourst (unsigned) current_event.dwProcessId, (unsigned) current_event.dwThreadId, "LOAD_DLL_DEBUG_EVENT")); + CloseHandle (current_event.u.LoadDll.hFile); catch_errors (handle_load_dll, NULL, (char *) "", RETURN_MASK_ALL); registers_changed (); /* mark all regs invalid */ ourstatus->kind = TARGET_WAITKIND_LOADED; @@ -1207,6 +1209,8 @@ child_create_inferior (char *exec_file, char *allargs, char **env) if (!ret) error ("Error creating process %s, (error %d)\n", exec_file, GetLastError ()); + CloseHandle (pi.hThread); + CloseHandle (pi.hProcess); do_initial_child_stuff (pi.dwProcessId); /* child_continue (DBG_CONTINUE, -1); */ |