Output the Ada task name in more messages.
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 8 Jun 2019 17:47:51 +0000 (19:47 +0200)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Thu, 12 Sep 2019 19:57:10 +0000 (21:57 +0200)
commit4993045d18d69ecee41ca341cde6bbed220dc8a4
tree45c461f5ed3751b96e92d99064128f57ca3d76c6
parent0d41d9a2aa059e89d46e549d7d3a367a35a4b739
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.
gdb/ChangeLog
gdb/NEWS
gdb/ada-tasks.c
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/rdv_wait.exp
gdb/testsuite/gdb.ada/task_switch_in_core.exp
This page took 0.028368 seconds and 4 git commands to generate.