* thread.c (print_thread_info): Don't insist
authorVladimir Prus <vladimir@codesourcery.com>
Mon, 17 Mar 2008 18:41:29 +0000 (18:41 +0000)
committerVladimir Prus <vladimir@codesourcery.com>
Mon, 17 Mar 2008 18:41:29 +0000 (18:41 +0000)
    on having current thread if there are no
    threads at all.

gdb/ChangeLog
gdb/thread.c

index 3ead9fa5ab448372eb78364fe6078ce32b220801..cc9020e41ed2299fae32ff6b6239c25d463ced72 100644 (file)
@@ -1,3 +1,9 @@
+2008-03-17  Vladimir Prus  <vladimir@codesourcery.com>
+
+       * thread.c (print_thread_info): Don't insist
+       on having current thread if there are no
+       threads at all.
+
 2008-03-17  Pedro Alves  <pedro@codesourcery.com>
 
        * infcmd.c (attach_command_post_wait)
index 1ce514a2d2e1d77c92f1087fb45d643b5eff718c..87dcbd727b83cbd57011ab6d931ae6775367fc26 100644 (file)
@@ -478,8 +478,8 @@ print_thread_info (struct ui_out *uiout, int requested_thread)
 
   if (requested_thread == -1)
     {
-      gdb_assert (current_thread != -1);
-      if (ui_out_is_mi_like_p (uiout))
+      gdb_assert (current_thread != -1 || !thread_list);
+      if (current_thread != -1 && ui_out_is_mi_like_p (uiout))
        ui_out_field_int (uiout, "current-thread-id", current_thread);
     }