namespace windows_nat
{
-/* Info about a potential pending stop. Each thread holds one of
- these. See "windows_thread_info::pending_stop" for more
- information. */
-struct pending_stop
-{
- /* The target waitstatus we computed. TARGET_WAITKIND_IGNORE if the
- thread does not have a pending stop. */
- target_waitstatus status;
-};
-
struct windows_process_info;
/* Thread information structure used to track extra information about
effect of trying to single step thread A -- leaving all other
threads suspended -- and then seeing a stop in thread B. To handle
this scenario, we queue all such "pending" stops here, and then
- process them once the step has completed. See PR gdb/22992. */
- struct pending_stop pending_stop {};
+ process them once the step has completed. See PR gdb/22992.
+
+ TARGET_WAITKIND_IGNORE if the thread does not have a pending
+ stop. */
+ target_waitstatus pending_status;
/* The last Windows event returned by WaitForDebugEvent for this
thread. */
{
if ((id == -1 || id == (int) th->tid)
&& !th->suspended
- && th->pending_stop.status.kind () != TARGET_WAITKIND_IGNORE)
+ && th->pending_status.kind () != TARGET_WAITKIND_IGNORE)
{
DEBUG_EVENTS ("got matching pending stop event "
"for 0x%x, not resuming",
DWORD thread_id = 0;
/* If there is a relevant pending stop, report it now. See the
- comment by the definition of "windows_thread_info::pending_stop"
+ comment by the definition of "windows_thread_info::pending_status"
for details on why this is needed. */
for (auto &th : windows_process.thread_list)
{
if (!th->suspended
- && th->pending_stop.status.kind () != TARGET_WAITKIND_IGNORE)
+ && th->pending_status.kind () != TARGET_WAITKIND_IGNORE)
{
DEBUG_EVENTS ("reporting pending event for 0x%x", th->tid);
thread_id = th->tid;
- *ourstatus = th->pending_stop.status;
- th->pending_stop.status.set_ignore ();
+ *ourstatus = th->pending_status;
+ th->pending_status.set_ignore ();
*current_event = th->last_event;
ptid_t ptid (windows_process.process_id, thread_id);
if (th->suspended)
{
/* Pending stop. See the comment by the definition of
- "pending_stops" for details on why this is needed. */
+ "pending_status" for details on why this is needed. */
DEBUG_EVENTS ("get_windows_debug_event - "
"unexpected stop in suspended thread 0x%x",
thread_id);
th->pc_adjusted = false;
}
- th->pending_stop.status = *ourstatus;
+ th->pending_status = *ourstatus;
ourstatus->set_ignore ();
continue_last_debug_event_main_thread
}
if (!th->suspended
- && th->pending_stop.status.kind () != TARGET_WAITKIND_IGNORE)
+ && th->pending_status.kind () != TARGET_WAITKIND_IGNORE)
any_pending = true;
});
auto *th = static_cast<windows_thread_info *> (thread.target_data ());
if (!th->suspended
- && th->pending_stop.status.kind () != TARGET_WAITKIND_IGNORE)
+ && th->pending_status.kind () != TARGET_WAITKIND_IGNORE)
{
- *ourstatus = th->pending_stop.status;
- th->pending_stop.status.set_ignore ();
+ *ourstatus = th->pending_status;
+ th->pending_status.set_ignore ();
*current_event = th->last_event;
ptid = debug_event_ptid (current_event);
switch_to_thread (find_thread_ptid (ptid));
if (th != nullptr && th->suspended)
{
/* Pending stop. See the comment by the definition of
- "windows_thread_info::pending_stop" for details on why this
+ "windows_thread_info::pending_status" for details on why this
is needed. */
OUTMSG2 (("get_windows_debug_event - "
"unexpected stop in suspended thread 0x%x\n",
th->tid));
maybe_adjust_pc (*current_event);
- th->pending_stop.status = *ourstatus;
+ th->pending_status = *ourstatus;
ourstatus->set_spurious ();
}
else