Make target_ops::has_execution take an 'inferior *' instead of a ptid_t
[deliverable/binutils-gdb.git] / gdb / inferior.c
index cf2175494d166620abd014aab1199b0cbf0f096e..3969ace13a848a411b6944ef45cf9cbfe0f7fcf8 100644 (file)
@@ -1,6 +1,6 @@
 /* Multi-process control for GDB, the GNU debugger.
 
-   Copyright (C) 2008-2019 Free Software Foundation, Inc.
+   Copyright (C) 2008-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -220,14 +220,6 @@ exit_inferior (inferior *inf)
   exit_inferior_1 (inf, 0);
 }
 
-void
-exit_inferior_silent (int pid)
-{
-  struct inferior *inf = find_inferior_pid (pid);
-
-  exit_inferior_1 (inf, 1);
-}
-
 void
 exit_inferior_silent (inferior *inf)
 {
@@ -255,6 +247,7 @@ inferior_appeared (struct inferior *inf, int pid)
 {
   /* If this is the first inferior with threads, reset the global
      thread id.  */
+  delete_exited_threads ();
   if (!any_thread_p ())
     init_thread_list ();
 
@@ -352,7 +345,7 @@ number_of_live_inferiors (void)
   int num_inf = 0;
 
   for (inferior *inf : all_non_exited_inferiors ())
-    if (target_has_execution_1 (ptid_t (inf->pid)))
+    if (inf->has_execution ())
       for (thread_info *tp ATTRIBUTE_UNUSED : inf->non_exited_threads ())
        {
          /* Found a live thread in this inferior, go to the next
@@ -378,24 +371,22 @@ have_live_inferiors (void)
 void
 prune_inferiors (void)
 {
-  struct inferior *ss, **ss_link;
+  inferior *ss;
 
   ss = inferior_list;
-  ss_link = &inferior_list;
   while (ss)
     {
       if (!ss->deletable ()
          || !ss->removable
          || ss->pid != 0)
        {
-         ss_link = &ss->next;
-         ss = *ss_link;
+         ss = ss->next;
          continue;
        }
 
-      *ss_link = ss->next;
+      inferior *ss_next = ss->next;
       delete_inferior (ss);
-      ss = *ss_link;
+      ss = ss_next;
     }
 }
 
This page took 0.027125 seconds and 4 git commands to generate.