+2020-05-27 Hannes Domani <ssbssa@yahoo.de>
+
+ * win32-low.cc (do_initial_child_stuff): Set open_process_used.
+ (win32_clear_inferiors): Use open_process_used.
+ (get_child_debug_event): Likewise.
+
2020-05-25 Michael Weghorn <m.weghorn@posteo.de>
PR gdbserver/25893
by suspending all the threads. */
static int faked_breakpoint = 0;
+/* True if current_process_handle needs to be closed. */
+static bool open_process_used = false;
+
#ifdef __x86_64__
bool wow64_process = false;
#endif
soft_interrupt_requested = 0;
faked_breakpoint = 0;
+ open_process_used = true;
memset (¤t_event, 0, sizeof (current_event));
static void
win32_clear_inferiors (void)
{
- if (current_process_handle != NULL)
- CloseHandle (current_process_handle);
+ if (open_process_used)
+ {
+ CloseHandle (current_process_handle);
+ open_process_used = false;
+ }
for_each_thread (delete_thread_info);
siginfo_er.ExceptionCode = 0;
(unsigned) current_event.dwThreadId));
CloseHandle (current_event.u.CreateProcessInfo.hFile);
+ if (open_process_used)
+ {
+ CloseHandle (current_process_handle);
+ open_process_used = false;
+ }
+
current_process_handle = current_event.u.CreateProcessInfo.hProcess;
main_thread_id = current_event.dwThreadId;
}
}
child_continue (DBG_CONTINUE, desired_stop_thread_id);
- CloseHandle (current_process_handle);
- current_process_handle = NULL;
break;
case LOAD_DLL_DEBUG_EVENT: