/* There are no resumed children left in the program. */
TARGET_WAITKIND_NO_RESUMED,
+ /* The thread was cloned. The event's ptid corresponds to the
+ cloned parent. The cloned child is held stopped at its entry
+ point, and its ptid is in the event's m_child_ptid. The target
+ must not add the cloned child to GDB's thread list until
+ target_ops::follow_clone() is called. */
+ TARGET_WAITKIND_THREAD_CLONED,
+
/* The thread was created. */
TARGET_WAITKIND_THREAD_CREATED,
TARGET_WAITKIND_THREAD_EXITED,
};
+/* Determine if KIND represents an event with a new child - a fork,
+ vfork, or clone. */
+
+static inline bool
+is_new_child_status (target_waitkind kind)
+{
+ return (kind == TARGET_WAITKIND_FORKED
+ || kind == TARGET_WAITKIND_VFORKED
+ || kind == TARGET_WAITKIND_THREAD_CLONED);
+}
+
/* Return KIND as a string. */
static inline const char *
return "FORKED";
case TARGET_WAITKIND_VFORKED:
return "VFORKED";
+ case TARGET_WAITKIND_THREAD_CLONED:
+ return "THREAD_CLONED";
case TARGET_WAITKIND_EXECD:
return "EXECD";
case TARGET_WAITKIND_VFORK_DONE:
return *this;
}
+ target_waitstatus &set_thread_cloned (ptid_t child_ptid)
+ {
+ this->reset ();
+ m_kind = TARGET_WAITKIND_THREAD_CLONED;
+ m_value.child_ptid = child_ptid;
+ return *this;
+ }
+
target_waitstatus &set_thread_created ()
{
this->reset ();
ptid_t child_ptid () const
{
- gdb_assert (m_kind == TARGET_WAITKIND_FORKED
- || m_kind == TARGET_WAITKIND_VFORKED);
+ gdb_assert (is_new_child_status (m_kind));
return m_value.child_ptid;
}