diff options
Diffstat (limited to 'gdb/windows-nat.c')
-rw-r--r-- | gdb/windows-nat.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 0fee4ad..f74ea0c 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -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) @@ -2422,7 +2426,7 @@ redir_set_redirection (const char *s, int *inp, int *out, int *err) /* cmd.exe recognizes "&N" only immediately after the redirection symbol. */ if (*s != '&') { - while (isspace (*s)) /* skip whitespace before file name */ + while (c_isspace (*s)) /* skip whitespace before file name */ s++; *d++ = ' '; /* separate file name with a single space */ } @@ -2449,7 +2453,7 @@ redir_set_redirection (const char *s, int *inp, int *out, int *err) s++; *d++ = *s++; } - else if (isspace (*s) && !quote) + else if (c_isspace (*s) && !quote) break; else *d++ = *s++; @@ -2485,7 +2489,7 @@ redirect_inferior_handles (const char *cmd_orig, char *cmd, int quote = 0; bool retval = false; - while (isspace (*s)) + while (c_isspace (*s)) *d++ = *s++; while (*s) @@ -3089,9 +3093,7 @@ windows_nat_target::thread_name (struct thread_info *thr) } -void _initialize_windows_nat (); -void -_initialize_windows_nat () +INIT_GDB_FILE (windows_nat) { x86_dr_low.set_control = cygwin_set_dr7; x86_dr_low.set_addr = cygwin_set_dr; @@ -3265,9 +3267,7 @@ windows_nat_target::thread_alive (ptid_t ptid) return WaitForSingleObject (th->h, 0) != WAIT_OBJECT_0; } -void _initialize_check_for_gdb_ini (); -void -_initialize_check_for_gdb_ini () +INIT_GDB_FILE (check_for_gdb_ini) { char *homedir; if (inhibit_gdbinit) |