diff options
author | Joel Brobecker <brobecker@gnat.com> | 2009-04-23 18:55:20 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2009-04-23 18:55:20 +0000 |
commit | 5e7b5f74c234fb11db064df93e309463a9058740 (patch) | |
tree | f9c34ba27384dee3641b36105e26baa7fe51e9f8 /gdb/ada-tasks.c | |
parent | 465f42bbe4d77444c30a9ffea8faebb794c2596f (diff) | |
download | gdb-5e7b5f74c234fb11db064df93e309463a9058740.zip gdb-5e7b5f74c234fb11db064df93e309463a9058740.tar.gz gdb-5e7b5f74c234fb11db064df93e309463a9058740.tar.bz2 |
* ada-tasks (task_command_1): Call target_find_new_threads.
Diffstat (limited to 'gdb/ada-tasks.c')
-rw-r--r-- | gdb/ada-tasks.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c index f7bbf2d..14f2503 100644 --- a/gdb/ada-tasks.c +++ b/gdb/ada-tasks.c @@ -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); |