]> Git Repo - binutils.git/blobdiff - gdb/linux-nat.c
* gnu-nat.c (gnu_attach): Add process to inferiors table.
[binutils.git] / gdb / linux-nat.c
index bbf8fb75fd3b156aef2b07278aefe58ef4f3d5cb..c1cb563d09a0c6bcbfa630f4c35e9dc8ed4e2b28 100644 (file)
@@ -711,6 +711,10 @@ linux_child_follow_fork (struct target_ops *ops, int follow_child)
       else
        {
          struct fork_info *fp;
+
+         /* Add process to GDB's tables.  */
+         add_inferior (child_pid);
+
          /* Retain child fork in ptrace (stopped) state.  */
          fp = find_fork_pid (child_pid);
          if (!fp)
@@ -822,7 +826,10 @@ linux_child_follow_fork (struct target_ops *ops, int follow_child)
         safely resume it.  */
 
       if (has_vforked)
-       linux_parent_pid = parent_pid;
+       {
+         linux_parent_pid = parent_pid;
+         detach_inferior (parent_pid);
+       }
       else if (!detach_fork)
        {
          struct fork_info *fp;
@@ -836,6 +843,7 @@ linux_child_follow_fork (struct target_ops *ops, int follow_child)
        target_detach (NULL, 0);
 
       inferior_ptid = ptid_build (child_pid, child_pid, 0);
+      add_inferior (child_pid);
 
       /* Reinstall ourselves, since we might have been removed in
         target_detach (which does other necessary cleanup).  */
This page took 0.02201 seconds and 4 git commands to generate.