* linux-low.c (linux_remove_process): Remove `detaching'
[deliverable/binutils-gdb.git] / gdb / gdbserver / linux-low.c
index 8e91d2b608a940c58c107b2f07c2596bb3abee7a..4c636e1bcf9602c9af89f51b82a9739475c824e1 100644 (file)
@@ -258,14 +258,10 @@ linux_add_process (int pid, int attached)
    also freeing all private data.  */
 
 static void
-linux_remove_process (struct process_info *process, int detaching)
+linux_remove_process (struct process_info *process)
 {
   struct process_info_private *priv = process->private;
 
-#ifdef USE_THREAD_DB
-  thread_db_free (process, detaching);
-#endif
-
   free (priv->arch_private);
   free (priv);
   remove_process (process);
@@ -736,8 +732,11 @@ linux_kill (int pid)
       lwpid = linux_wait_for_event (lwp->head.id, &wstat, __WALL);
     } while (lwpid > 0 && WIFSTOPPED (wstat));
 
+#ifdef USE_THREAD_DB
+  thread_db_free (process, 0);
+#endif
   delete_lwp (lwp);
-  linux_remove_process (process, 0);
+  linux_remove_process (process);
   return 0;
 }
 
@@ -821,12 +820,16 @@ linux_detach (int pid)
   if (process == NULL)
     return -1;
 
+#ifdef USE_THREAD_DB
+  thread_db_free (process, 1);
+#endif
+
   current_inferior =
     (struct thread_info *) find_inferior (&all_threads, any_thread_of, &pid);
 
   delete_all_breakpoints ();
   find_inferior (&all_threads, linux_detach_one_lwp, &pid);
-  linux_remove_process (process, 1);
+  linux_remove_process (process);
   return 0;
 }
 
@@ -1451,8 +1454,11 @@ retry:
          int pid = pid_of (lwp);
          struct process_info *process = find_process_pid (pid);
 
+#ifdef USE_THREAD_DB
+         thread_db_free (process, 0);
+#endif
          delete_lwp (lwp);
-         linux_remove_process (process, 0);
+         linux_remove_process (process);
 
          current_inferior = NULL;
 
This page took 0.024821 seconds and 4 git commands to generate.