This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Output the Ada task name in more messages.
- From: Tom Tromey <tom at tromey dot com>
- To: Philippe Waroquiers <philippe dot waroquiers at skynet dot be>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 24 Jul 2019 12:05:54 -0600
- Subject: Re: [RFA] Output the Ada task name in more messages.
- References: <20190609084637.14513-1-philippe.waroquiers@skynet.be>
>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:
Philippe> With this patch, we e.g. get:
Philippe> [Switching to task 2 task_list(1)]
Philippe> [Current task is 2 task_list(1)]
Philippe> instead of
Philippe> [Switching to task 2]
Philippe> [Current task is 2]
Thank you for the patch.
When printing the name of a thread, gdb surrounds it in quotes:
uiout->text (" \"");
uiout->field_string ("name", name);
uiout->text ("\"");
Would this also make sense for Ada task names?
Philippe> +/* Return a string with TASKNO followed by the task name if TASK_INFO
Philippe> + contains a name. */
Philippe> +
Philippe> +static std::string
Philippe> +task_to_str (int taskno, const ada_task_info *task_info)
Philippe> +{
Philippe> + if (task_info->name[0] == '\0')
Philippe> + return string_printf ("%d", taskno);
Philippe> + else
Philippe> + return string_printf ("%d %s", taskno, task_info->name);
Indentation looks off here.
Otherwise this patch looks good to me.
Tom