* ada-tasks (task_command_1): Call target_find_new_threads.
authorJoel Brobecker <brobecker@gnat.com>
Thu, 23 Apr 2009 18:55:20 +0000 (18:55 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Thu, 23 Apr 2009 18:55:20 +0000 (18:55 +0000)
gdb/ChangeLog
gdb/ada-tasks.c

index a6917cb059ec60723c66209ba05f878e1908ba51..ec17070d71c72c0c9fe1863325e41f4799bd9823 100644 (file)
@@ -1,3 +1,7 @@
+2009-04-23  Joel Brobecker  <brobecker@adacore.com>
+
+       * ada-tasks (task_command_1): Call target_find_new_threads.
+
 2009-04-23  Joel Brobecker  <brobecker@adacore.com>
 
        * stack.c (do_gdb_disassembly): Print the exception message if an
index f7bbf2dff909398919faa38c9e9aba6da3a6a561..14f2503f874988e5cbb87d54bc02068ee0bf6498 100644 (file)
@@ -865,6 +865,15 @@ task_command_1 (char *taskno_str, int from_tty)
   if (!ada_task_is_alive (task_info))
     error (_("Cannot switch to task %d: Task is no longer running"), taskno);
    
+  /* On some platforms, the thread list is not updated until the user
+     performs a thread-related operation (by using the "info threads"
+     command, for instance).  So this thread list may not be up to date
+     when the user attempts this task switch.  Since we cannot switch
+     to the thread associated to our task if GDB does not know about
+     that thread, we need to make sure that any new threads gets added
+     to the thread list.  */
+  target_find_new_threads ();
+
   switch_to_thread (task_info->ptid);
   ada_find_printable_frame (get_selected_frame (NULL));
   printf_filtered (_("[Switching to task %d]\n"), taskno);
This page took 0.026688 seconds and 4 git commands to generate.