Change inferior thread list to be a thread map
[deliverable/binutils-gdb.git] / gdb / inferior.c
index c2e9da3d3d55b5a53c0d461f84eea806547857b9..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;
@@ -640,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.023747 seconds and 4 git commands to generate.