gdb/remote: remove_new_fork_children don't access target_waitstatus::child_ptid if...
[deliverable/binutils-gdb.git] / gdb / remote.c
index 61487456ce8b2f107467a750aa67cc4870834f72..fbc5ab269bada131338ed3a6359f01ee52aec7ad 100644 (file)
@@ -7276,9 +7276,10 @@ remote_target::remove_new_fork_children (threads_listing_context *context)
   remote_notif_get_pending_events (notif);
   for (auto &event : get_remote_state ()->stop_reply_queue)
     if (event->ws.kind == TARGET_WAITKIND_FORKED
-       || event->ws.kind == TARGET_WAITKIND_VFORKED
-       || event->ws.kind == TARGET_WAITKIND_THREAD_EXITED)
+       || event->ws.kind == TARGET_WAITKIND_VFORKED)
       context->remove_thread (event->ws.value.related_pid);
+    else if (event->ws.kind == TARGET_WAITKIND_THREAD_EXITED)
+      context->remove_thread (event->ptid);
 }
 
 /* Check whether any event pending in the vStopped queue would prevent a
This page took 0.02713 seconds and 4 git commands to generate.