diff options
author | Philippe Waroquiers <philippe.waroquiers@skynet.be> | 2019-06-08 19:47:51 +0200 |
---|---|---|
committer | Philippe Waroquiers <philippe.waroquiers@skynet.be> | 2019-09-12 21:57:10 +0200 |
commit | 4993045d18d69ecee41ca341cde6bbed220dc8a4 (patch) | |
tree | 45c461f5ed3751b96e92d99064128f57ca3d76c6 /gdb/doc | |
parent | 0d41d9a2aa059e89d46e549d7d3a367a35a4b739 (diff) | |
download | gdb-4993045d18d69ecee41ca341cde6bbed220dc8a4.zip gdb-4993045d18d69ecee41ca341cde6bbed220dc8a4.tar.gz gdb-4993045d18d69ecee41ca341cde6bbed220dc8a4.tar.bz2 |
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.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 14 |
2 files changed, 12 insertions, 7 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 96c0409..4705fbc 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2019-09-12 Philippe Waroquiers <philippe.waroquiers@skynet.be> + + * gdb.texinfo (Ada Tasks): Tell the task name is printed, update + examples. + 2019-09-10 Tom Tromey <tromey@adacore.com> * gdb.texinfo (Index Files): Update Ada text. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 79824a0..eee0c9d 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -17751,10 +17751,10 @@ the following example: * 2 807c468 1 15 Runnable task_1 (@value{GDBP}) info task 2 Ada Task: 0x807c468 -Name: task_1 +Name: "task_1" Thread: 0 LWP: 0x1fac -Parent: 1 (main_task) +Parent: 1 ("main_task") Base Priority: 15 State: Runnable @end smallexample @@ -17762,7 +17762,7 @@ State: Runnable @item task @kindex task@r{ (Ada)} @cindex current Ada task ID -This command prints the ID of the current task. +This command prints the ID and name of the current task. @smallexample @iftex @@ -17771,9 +17771,9 @@ This command prints the ID of the current task. (@value{GDBP}) info tasks ID TID P-ID Pri State Name 1 8077870 0 15 Child Activation Wait main_task -* 2 807c458 1 15 Runnable t +* 2 807c458 1 15 Runnable some_task (@value{GDBP}) task -[Current task is 2] +[Current task is 2 "some_task"] @end smallexample @item task @var{taskno} @@ -17789,9 +17789,9 @@ from the current task to the given task. (@value{GDBP}) info tasks ID TID P-ID Pri State Name 1 8077870 0 15 Child Activation Wait main_task -* 2 807c458 1 15 Runnable t +* 2 807c458 1 15 Runnable some_task (@value{GDBP}) task 1 -[Switching to task 1] +[Switching to task 1 "main_task"] #0 0x8067726 in pthread_cond_wait () (@value{GDBP}) bt #0 0x8067726 in pthread_cond_wait () |