gdbserver: hide fork child threads from GDB
[deliverable/binutils-gdb.git] / gdbserver / server.cc
index 97854e71b45996b1c7c6df0b970bce8a58bc0aeb..725fb3b757e271087f8199d00f6d64c11e6d8853 100644 (file)
@@ -1657,6 +1657,12 @@ handle_qxfer_threads_worker (thread_info *thread, struct buffer *buffer)
   gdb_byte *handle;
   bool handle_status = target_thread_handle (ptid, &handle, &handle_len);
 
+  /* If this is a fork or vfork child (has a fork parent), GDB does not yet
+     know about this process, and must not know about it until it gets the
+     corresponding (v)fork event.  Exclude this thread from the list.  */
+  if (target_thread_pending_parent (thread) != nullptr)
+    return;
+
   write_ptid (ptid_s, ptid);
 
   buffer_xml_printf (buffer, "<thread id=\"%s\"", ptid_s);
This page took 0.023093 seconds and 4 git commands to generate.