Thu May 21 13:14:25 1998 John Metzler <jmetzler@cygnus.com>
[deliverable/binutils-gdb.git] / gdb / thread.c
index 7ffc65af811f2d3ff0daa9c95bb16557fbf9becc..4c158ffb5a63c008d92da50a9df69ebd91d4c4c1 100644 (file)
@@ -125,6 +125,31 @@ add_thread (pid)
   thread_list = tp;
 }
 
+void
+delete_thread (pid)
+     int pid;
+{
+  struct thread_info *tp, *tpprev;
+
+  tpprev = NULL;
+
+  for (tp = thread_list; tp; tpprev = tp, tp = tp->next)
+    if (tp->pid == pid)
+      break;
+
+  if (!tp)
+    return;
+
+  if (tpprev)
+    tpprev->next = tp->next;
+  else
+    thread_list = tp->next;
+
+  free (tp);
+
+  return;
+}
+
 static struct thread_info *
 find_thread_id (num)
     int num;
@@ -322,6 +347,10 @@ info_threads_command (arg, from_tty)
   if (!target_has_stack) error ("No stack.");
 
   prune_threads ();
+#if defined(FIND_NEW_THREADS)
+  FIND_NEW_THREADS ();
+#endif
+
   for (tp = thread_list; tp; tp = tp->next)
     {
       if (tp->pid == current_pid)
@@ -332,7 +361,10 @@ info_threads_command (arg, from_tty)
       printf_filtered ("%d %s  ", tp->num, target_pid_to_str (tp->pid));
 
       switch_to_thread (tp->pid);
-      print_stack_frame (selected_frame, -1, 0);
+      if (selected_frame)
+       print_stack_frame (selected_frame, -1, 0);
+      else
+       printf_filtered ("[No stack.]\n");
     }
 
   switch_to_thread (current_pid);
This page took 0.024209 seconds and 4 git commands to generate.