+2020-04-08 Tom Tromey <tromey@adacore.com>
+
+ * windows-nat.c (wait_for_debug_event): Move to
+ nat/windows-nat.c.
+ * nat/windows-nat.h (wait_for_debug_event): Declare.
+ * nat/windows-nat.c (wait_for_debug_event): Move from
+ windows-nat.c. No longer static.
+
2020-04-08 Tom Tromey <tromey@adacore.com>
* windows-nat.c (get_windows_debug_event): Use
continue_status);
}
+/* See nat/windows-nat.h. */
+
+BOOL
+wait_for_debug_event (DEBUG_EVENT *event, DWORD timeout)
+{
+ BOOL result = WaitForDebugEvent (event, timeout);
+ if (result)
+ last_wait_event = *event;
+ return result;
+}
}
extern BOOL continue_last_debug_event (DWORD continue_status,
bool debug_events);
+/* A simple wrapper for WaitForDebugEvent that also sets
+ 'last_wait_event' on success. */
+
+extern BOOL wait_for_debug_event (DEBUG_EVENT *event, DWORD timeout);
+
}
#endif
return TRUE;
}
-/* A wrapper for WaitForDebugEvent that sets "last_wait_event"
- appropriately. */
-static BOOL
-wait_for_debug_event (DEBUG_EVENT *event, DWORD timeout)
-{
- BOOL result = WaitForDebugEvent (event, timeout);
- if (result)
- last_wait_event = *event;
- return result;
-}
-
/* Get the next event from the child. Returns a non-zero thread id if the event
requires handling by WFI (or whatever). */
+2020-04-08 Tom Tromey <tromey@adacore.com>
+
+ * win32-low.c (win32_kill, get_child_debug_event): Use
+ wait_for_debug_event.
+
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.c (child_continue): Call continue_last_debug_event.
{
if (!child_continue (DBG_CONTINUE, -1))
break;
- if (!WaitForDebugEvent (¤t_event, INFINITE))
+ if (!wait_for_debug_event (¤t_event, INFINITE))
break;
if (current_event.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT)
break;
happen is the user will see a spurious breakpoint. */
current_event.dwDebugEventCode = 0;
- if (!WaitForDebugEvent (¤t_event, 0))
+ if (!wait_for_debug_event (¤t_event, 0))
{
OUTMSG2(("no attach events left\n"));
fake_breakpoint_event ();
/* Keep the wait time low enough for comfortable remote
interruption, but high enough so gdbserver doesn't become a
bottleneck. */
- if (!WaitForDebugEvent (¤t_event, 250))
+ if (!wait_for_debug_event (¤t_event, 250))
{
DWORD e = GetLastError();