+
+ tp = find_thread_pid (ptid);
+ gdb_assert (tp);
+ return tp->state_ == state;
+}
+
+int
+is_stopped (ptid_t ptid)
+{
+ /* Without execution, this property is always true. */
+ if (!target_has_execution)
+ return 1;
+
+ return is_thread_state (ptid, THREAD_STOPPED);
+}
+
+int
+is_exited (ptid_t ptid)
+{
+ /* Without execution, this property is always false. */
+ if (!target_has_execution)
+ return 0;
+
+ return is_thread_state (ptid, THREAD_EXITED);
+}
+
+int
+is_running (ptid_t ptid)
+{
+ /* Without execution, this property is always false. */
+ if (!target_has_execution)
+ return 0;
+
+ return is_thread_state (ptid, THREAD_RUNNING);
+}
+
+int
+any_running (void)
+{
+ struct thread_info *tp;
+
+ if (!target_has_execution)
+ return 0;
+
+ 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;
+
+ if (!target_has_execution)
+ return 0;
+
+ tp = find_thread_pid (ptid);
+ gdb_assert (tp);
+ return tp->executing_;
+}
+
+void
+set_executing (ptid_t ptid, int executing)
+{
+ struct thread_info *tp;
+ int all = ptid_equal (ptid, minus_one_ptid);
+
+ if (all || ptid_is_pid (ptid))
+ {
+ for (tp = thread_list; tp; tp = tp->next)
+ if (all || ptid_get_pid (tp->ptid) == ptid_get_pid (ptid))
+ tp->executing_ = executing;
+ }
+ else