Support clone events in the remote protocol

The previous patch taught GDB about a new
TARGET_WAITKIND_THREAD_CLONED event kind, and made the Linux target
report clone events.

A following patch will teach Linux GDBserver to do the same thing.

But before we get there, we need to teach the remote protocol about
TARGET_WAITKIND_THREAD_CLONED.  That's what this patch does.  Clone is
very similar to vfork and fork, and the new stop reply is likewise
handled similarly.  The stub reports "T05clone:...".

GDBserver core is taught to handle TARGET_WAITKIND_THREAD_CLONED and
forward it to GDB in this patch, but no backend actually emits it yet.
That will be done in a following patch.

Documentation for this new remote protocol feature is included in a
documentation patch later in the series.

Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Change-Id: If271f20320d864f074d8ac0d531cc1a323da847f
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=19675
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27830
This commit is contained in:
Pedro Alves
2021-11-23 20:35:12 +00:00
parent 0d36baa9af
commit 53de5394f7
3 changed files with 89 additions and 38 deletions

View File

@@ -241,7 +241,8 @@ in_queued_stop_replies_ptid (struct notif_event *event, ptid_t filter_ptid)
/* Don't resume fork children that GDB does not know about yet. */
if ((vstop_event->status.kind () == TARGET_WAITKIND_FORKED
|| vstop_event->status.kind () == TARGET_WAITKIND_VFORKED)
|| vstop_event->status.kind () == TARGET_WAITKIND_VFORKED
|| vstop_event->status.kind () == TARGET_WAITKIND_THREAD_CLONED)
&& vstop_event->status.child_ptid ().matches (filter_ptid))
return true;