aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/infrun.c10
-rw-r--r--gdb/process-stratum-target.h5
2 files changed, 6 insertions, 9 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 6c652ea..bec8e83 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -2800,15 +2800,7 @@ maybe_set_commit_resumed_all_targets ()
status to report, handle it before requiring the target to
commit its resumed threads: handling the status might lead to
resuming more threads. */
- bool has_thread_with_pending_status = false;
- for (thread_info *thread : all_non_exited_threads (proc_target))
- if (thread->resumed () && thread->has_pending_waitstatus ())
- {
- has_thread_with_pending_status = true;
- break;
- }
-
- if (has_thread_with_pending_status)
+ if (proc_target->has_resumed_with_pending_wait_status ())
{
infrun_debug_printf ("not requesting commit-resumed for target %s, a"
" thread has a pending waitstatus",
diff --git a/gdb/process-stratum-target.h b/gdb/process-stratum-target.h
index f037280..6bd8bc3 100644
--- a/gdb/process-stratum-target.h
+++ b/gdb/process-stratum-target.h
@@ -88,6 +88,11 @@ public:
target's "resumed with pending wait status" list. */
void maybe_remove_resumed_with_pending_wait_status (thread_info *thread);
+ /* Return true if this target has at least one resumed thread with a pending
+ wait status. */
+ bool has_resumed_with_pending_wait_status () const
+ { return !m_resumed_with_pending_wait_status.empty (); }
+
/* The connection number. Visible in "info connections". */
int connection_number = 0;