Change inferior thread list to be a thread map
[deliverable/binutils-gdb.git] / gdb / inferior.c
index eb090dfde1a5850c6619b51440762e277e1a008f..47dfca04bba273941500dbc6c4972555252cf8d1 100644 (file)
@@ -150,8 +150,8 @@ delete_inferior (struct inferior *todel)
   if (!inf)
     return;
 
-  for (thread_info *tp : inf->threads_safe ())
-    delete_thread_silent (tp);
+  for (thread_info *tp : inf->threads ())
+    delete_thread_silent_noremove (tp);
 
   if (infprev)
     infprev->next = inf->next;
@@ -182,14 +182,16 @@ exit_inferior_1 (struct inferior *inftoex, int silent)
   if (!inf)
     return;
 
-  for (thread_info *tp : inf->threads_safe ())
+  for (thread_info *tp : inf->threads ())
     {
       if (silent)
-       delete_thread_silent (tp);
+       delete_thread_silent_noremove (tp);
       else
-       delete_thread (tp);
+       delete_thread_noremove (tp);
     }
 
+  inf->thread_map.clear ();
+
   gdb::observers::inferior_exit.notify (inf);
 
   inf->pid = 0;
@@ -260,13 +262,6 @@ inferior_appeared (struct inferior *inf, int pid)
   gdb::observers::inferior_appeared.notify (inf);
 }
 
-void
-discard_all_inferiors (void)
-{
-  for (inferior *inf : all_non_exited_inferiors ())
-    exit_inferior_silent (inf);
-}
-
 struct inferior *
 find_inferior_id (int num)
 {
@@ -647,7 +642,7 @@ inferior_command (const char *args, int from_tty)
     {
       if (inf != current_inferior ())
        {
-         thread_info *tp = any_thread_of_inferior (inf);
+         thread_info *tp = first_thread_of_inferior (inf);
          if (tp == NULL)
            error (_("Inferior has no threads."));
 
This page took 0.025181 seconds and 4 git commands to generate.