aboutsummaryrefslogtreecommitdiff
path: root/gdb/windows-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/windows-nat.c')
-rw-r--r--gdb/windows-nat.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index e73a275..c001d38 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)
@@ -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)