[v2,1/2] Fix for pr 14236
Commit Message
Hi.
No changes in this patch. Resubmitting for completeness sake.
2014-07-12 Doug Evans <dje@google.com>
* gdbthread.h (any_running): Declare.
* thread.c (any_running): New function.
2014-07-12 Doug Evans <dje@google.com>
* gdbthread.h (any_running): Declare.
* thread.c (any_running): New function.
@@ -363,6 +363,9 @@ extern int is_exited (ptid_t ptid);
/* In the frontend's perpective, is this thread stopped? */
extern int is_stopped (ptid_t ptid);
+/* In the frontend's perpective is there any thread running? */
+extern int any_running (void);
+
/* Marks thread PTID as executing, or not. If ptid_get_pid (PTID) is -1,
marks all threads.
@@ -648,6 +648,18 @@ is_running (ptid_t ptid)
}
int
+any_running (void)
+{
+ struct thread_info *tp;
+
+ for (tp = thread_list; tp; tp = tp->next)
+ if (tp->state == THREAD_RUNNING)
+ return 1;
+
+ return 0;
+}
+
+int
is_executing (ptid_t ptid)
{
struct thread_info *tp;