+ nb_tasks = VEC_length (ada_task_info_s, data->task_list);
+
+ nb_columns = ui_out_is_mi_like_p (uiout) ? 8 : 7;
+ old_chain = make_cleanup_ui_out_table_begin_end (uiout, nb_columns,
+ nb_tasks, "tasks");
+ ui_out_table_header (uiout, 1, ui_left, "current", "");
+ ui_out_table_header (uiout, 3, ui_right, "id", "ID");
+ ui_out_table_header (uiout, 9, ui_right, "task-id", "TID");
+ /* The following column is provided in GDB/MI mode only because
+ it is only really useful in that mode, and also because it
+ allows us to keep the CLI output shorter and more compact. */
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_table_header (uiout, 4, ui_right, "thread-id", "");
+ ui_out_table_header (uiout, 4, ui_right, "parent-id", "P-ID");
+ ui_out_table_header (uiout, 3, ui_right, "priority", "Pri");
+ ui_out_table_header (uiout, 22, ui_left, "state", "State");
+ /* Use ui_noalign for the last column, to prevent the CLI uiout
+ from printing an extra space at the end of each row. This
+ is a bit of a hack, but does get the job done. */
+ ui_out_table_header (uiout, 1, ui_noalign, "name", "Name");
+ ui_out_table_body (uiout);
+
+ for (taskno = 1;
+ taskno <= VEC_length (ada_task_info_s, data->task_list);
+ taskno++)
+ {
+ const struct ada_task_info *const task_info =
+ VEC_index (ada_task_info_s, data->task_list, taskno - 1);
+ int parent_id;
+ struct cleanup *chain2;