diff options
Diffstat (limited to 'gdb/windows-nat.c')
-rw-r--r-- | gdb/windows-nat.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 2fd943e..939c581 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1,6 +1,6 @@ /* Target-vector operations for controlling windows child processes, for GDB. - Copyright (C) 1995-2024 Free Software Foundation, Inc. + Copyright (C) 1995-2025 Free Software Foundation, Inc. Contributed by Cygnus Solutions, A Red Hat Company. @@ -56,7 +56,6 @@ #include "cli/cli-style.h" #include <unistd.h> #include "exec.h" -#include "solist.h" #include "solib.h" #include "xml-support.h" #include "inttypes.h" @@ -433,7 +432,12 @@ wait_for_single (HANDLE handle, DWORD howlong) { while (true) { - DWORD r = WaitForSingleObject (handle, howlong); + /* Using an INFINITE argument to WaitForSingleObject may cause a system + deadlock. Avoid it by waiting for a bit in a loop instead. */ + DWORD milliseconds = howlong == INFINITE ? 100 : howlong; + DWORD r = WaitForSingleObject (handle, milliseconds); + if (howlong == INFINITE && r == WAIT_TIMEOUT) + continue; if (r == WAIT_OBJECT_0) return; if (r == WAIT_FAILED) @@ -1789,7 +1793,6 @@ windows_nat_target::do_initial_windows_stuff (DWORD pid, bool attaching) inf = current_inferior (); if (!inf->target_is_pushed (this)) inf->push_target (this); - disable_breakpoints_in_shlibs (current_program_space); windows_clear_solib (); clear_proceed_status (0); init_wait_for_inferior (); |