Output the Ada task name in more messages.
With this patch, we e.g. get:
[Switching to task 2 "task_list(1)"]
[Current task is 2 "task_list(1)"]
instead of
[Switching to task 2]
[Current task is 2]
The logic to produce the taskno optionally followed
by the task name has been factorized in the task_to_str function.
Task names are output between double quotes in the new messages,
similarly to what GDB does for thread names.
However, no quotes are put around task names in 'info tasks' Name column.
This was discussed with Tom, that preferred no quotes there, while I
was more in favour of visual consistency.
I discussed with a few more users, which led to (exactly) 50% preferring
quotes and 50% preferring no quotes :).
To arrive to the decision to remove the quotes, the following "killing args"
were used:
* To have quotes or to not have quotes, that is the question; yes
but not *THE* question :).
* If there is not a clear majority that prefers quotes, better to
not disturb the existing user basis for a (somewhat) irrelevant
aspect.
* The opinion of the reviewer has more weight.
So, compared to the previous version, this version remotes the quotes
in 'info tasks'.
It improves the alignement of 'info tasks' output.
With this patch, we get:
(gdb) info task
ID TID P-ID Pri State Name
* 1
555555759030 48 Runnable main_task
2
555555759e30 1 48 Selective Wait mit
(gdb)
instead of
(gdb) info task
ID TID P-ID Pri State Name
* 1
555555759030 48 Runnable main_task
2
555555759e30 1 48 Selective Wait mit
(gdb)
(e.g. the first one properly shows parent and priority under the
correct header).
This is version 4 of the 'task name' patch.
Compared to version 3, the changes are:
output task names between quotes but not in 'info tasks'
gdb/ChangeLog
2019-09-12 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* NEWS: Announce that Ada task names are now shown at more places,
and between quotes (except in info task output).
* gdb/ada-tasks.c (task_to_str): New function.
(display_current_task_id): Call task_to_str.
(task_command_1): Likewise.
(print_ada_task_info): In non-mi mode, Properly align headers and data
when task-id length is > 9 (9 is the default for a 32 bits CORE_ADDR).
gdb/doc/ChangeLog
2019-09-12 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* gdb.texinfo (Ada Tasks): Tell the task name is printed, update
examples.
gdb/testsuite/ChangeLog
2019-09-12 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* gdb.ada/rdv_wait.exp: Update to new task names.
* gdb.base/task_switch_in_core.exp: Likewise.
* gdb.base/info_sources_base.c: Likewise.