aboutsummaryrefslogtreecommitdiff
path: root/gdb/nat
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/nat')
-rw-r--r--gdb/nat/windows-nat.c28
-rw-r--r--gdb/nat/windows-nat.h7
2 files changed, 35 insertions, 0 deletions
diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c
index 2c2454b..823471e 100644
--- a/gdb/nat/windows-nat.c
+++ b/gdb/nat/windows-nat.c
@@ -343,6 +343,34 @@ matching_pending_stop (bool debug_events)
/* See nat/windows-nat.h. */
+gdb::optional<pending_stop>
+fetch_pending_stop (bool debug_events)
+{
+ gdb::optional<pending_stop> result;
+ for (auto iter = pending_stops.begin ();
+ iter != pending_stops.end ();
+ ++iter)
+ {
+ if (desired_stop_thread_id == -1
+ || desired_stop_thread_id == iter->thread_id)
+ {
+ result = *iter;
+ current_event = iter->event;
+
+ DEBUG_EVENTS (("get_windows_debug_event - "
+ "pending stop found in 0x%x (desired=0x%x)\n",
+ iter->thread_id, desired_stop_thread_id));
+
+ pending_stops.erase (iter);
+ break;
+ }
+ }
+
+ return result;
+}
+
+/* See nat/windows-nat.h. */
+
BOOL
continue_last_debug_event (DWORD continue_status, bool debug_events)
{
diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h
index 0e93165..68b72d4 100644
--- a/gdb/nat/windows-nat.h
+++ b/gdb/nat/windows-nat.h
@@ -22,6 +22,7 @@
#include <windows.h>
#include <vector>
+#include "gdbsupport/gdb_optional.h"
#include "target/waitstatus.h"
namespace windows_nat
@@ -231,6 +232,12 @@ extern handle_exception_result handle_exception
extern bool matching_pending_stop (bool debug_events);
+/* See if a pending stop matches DESIRED_STOP_THREAD_ID. If so,
+ remove it from the list of pending stops, set 'current_event', and
+ return it. Otherwise, return an empty optional. */
+
+extern gdb::optional<pending_stop> fetch_pending_stop (bool debug_events);
+
/* A simple wrapper for ContinueDebugEvent that continues the last
waited-for event. If DEBUG_EVENTS is true, logging will be
enabled. */