+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
+
+ /* Print a star if this task is the current task (or the task
+ currently selected). */
+ if (task_info->ptid == inferior_ptid)
+ uiout->field_string ("current", "*");
+ else
+ uiout->field_skip ("current");
+
+ /* Print the task number. */
+ uiout->field_signed ("id", taskno);
+
+ /* Print the Task ID. */
+ uiout->field_string ("task-id", phex_nz (task_info->task_id,
+ sizeof (CORE_ADDR)));
+
+ /* Print the associated Thread ID. */
+ if (uiout->is_mi_like_p ())
+ {
+ thread_info *thread = (ada_task_is_alive (task_info)
+ ? find_thread_ptid (inf, task_info->ptid)
+ : nullptr);
+
+ if (thread != NULL)
+ uiout->field_signed ("thread-id", thread->global_num);
+ else
+ {
+ /* This can happen if the thread is no longer alive. */
+ uiout->field_skip ("thread-id");
+ }
+ }
+
+ /* Print the ID of the parent task. */
+ parent_id = get_task_number_from_id (task_info->parent, inf);
+ if (parent_id)
+ uiout->field_signed ("parent-id", parent_id);
+ else
+ uiout->field_skip ("parent-id");
+
+ /* Print the base priority of the task. */
+ uiout->field_signed ("priority", task_info->priority);
+
+ /* Print the task current state. */
+ if (task_info->caller_task)
+ uiout->field_fmt ("state",
+ _("Accepting RV with %-4d"),
+ get_task_number_from_id (task_info->caller_task,
+ inf));
+ else if (task_info->called_task)
+ uiout->field_fmt ("state",
+ _("Waiting on RV with %-3d"),
+ get_task_number_from_id (task_info->called_task,
+ inf));
+ else
+ uiout->field_string ("state", task_states[task_info->state]);
+
+ /* Finally, print the task name, without quotes around it, as mi like
+ is not expecting quotes, and in non mi-like no need for quotes
+ as there is a specific column for the name. */
+ uiout->field_fmt ("name",
+ (task_info->name[0] != '\0'
+ ? ui_file_style ()
+ : metadata_style.style ()),
+ "%s",
+ (task_info->name[0] != '\0'
+ ? task_info->name
+ : _("<no name>")));
+
+ uiout->text ("\n");
+ }