gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gdb / mingw-hdep.c
index 8ed4b44ddce145c1cd567005f6183fdad26edad9..43d99747659e98b6ef9cb6d842737f2454d1b767 100644 (file)
@@ -1,6 +1,6 @@
 /* Host support routines for MinGW, for GDB, the GNU debugger.
 
-   Copyright (C) 2006-2019 Free Software Foundation, Inc.
+   Copyright (C) 2006-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "defs.h"
 #include "main.h"
 #include "serial.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 
-#include "gdb_select.h"
-#include "readline/readline.h"
+#include "gdbsupport/gdb_select.h"
 
 #include <windows.h>
 
@@ -65,6 +64,17 @@ gdb_select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
   int num_ready;
   size_t indx;
 
+  if (n == 0)
+    {
+      /* The MS API says that the first argument to
+        WaitForMultipleObjects cannot be zero.  That's why we just
+        use a regular Sleep here.  */
+      if (timeout != NULL)
+       Sleep (timeout->tv_sec * 1000 + timeout->tv_usec / 1000);
+
+      return 0;
+    }
+
   num_ready = 0;
   num_handles = 0;
   num_scbs = 0;
@@ -167,14 +177,6 @@ gdb_select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
        }
     }
 
-  /* With multi-threaded SIGINT handling, there is a race between the
-     readline signal handler and GDB.  It may still be in
-     rl_prep_terminal in another thread.  Do not return until it is
-     done; we can check the state here because we never longjmp from
-     signal handlers on Windows.  */
-  while (RL_ISSTATE (RL_STATE_SIGHANDLER))
-    Sleep (1);
-
   return num_ready;
 }
 
This page took 0.028576 seconds and 4 git commands to generate.