[RFA] Give thread names in thread events, give Ada task names in more output.

Message ID 1558269697.1454.11.camel@skynet.be
State New, archived
Headers

Commit Message

Philippe Waroquiers May 19, 2019, 12:41 p.m. UTC
  On Sat, 2019-05-18 at 22:03 +0300, Eli Zaretskii wrote:
> > From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
> > Cc: Philippe Waroquiers <philippe.waroquiers@skynet.be>
> > Date: Sat, 18 May 2019 20:23:06 +0200
> > 
> > With this patch, we e.g. get:
> >   [New Thread 0x7ffff701b700 (LWP 13891) "sleepers"]
> >   [Switching to thread 2 (Thread 0x7ffff781c700 (LWP 13890) "sleepers")]
> > instead of:
> >   [New Thread 0x7ffff701b700 (LWP 13918)]
> >   [Switching to thread 2 (Thread 0x7ffff781c700 (LWP 13917))]
> > 
> > For Ada tasks, 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]
> 
> Except for Ada, the names are only available on some platforms, right?
> Should we mention that in the manual?
The manual currently describes the thread name and the way GDB
shows the 'system thread name' only some systems in the command
'thread name' in the node 'Debugging Programs with Multiple Threads'.

What about the below addition ?
  

Comments

Eli Zaretskii May 19, 2019, 1:32 p.m. UTC | #1
On May 19, 2019 1:41:37 PM GMT+01:00, Philippe Waroquiers <philippe.waroquiers@skynet.be> wrote:
> On Sat, 2019-05-18 at 22:03 +0300, Eli Zaretskii wrote:
> > > From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
> > > Cc: Philippe Waroquiers <philippe.waroquiers@skynet.be>
> > > Date: Sat, 18 May 2019 20:23:06 +0200
> > > 
> > > With this patch, we e.g. get:
> > >   [New Thread 0x7ffff701b700 (LWP 13891) "sleepers"]
> > >   [Switching to thread 2 (Thread 0x7ffff781c700 (LWP 13890)
> "sleepers")]
> > > instead of:
> > >   [New Thread 0x7ffff701b700 (LWP 13918)]
> > >   [Switching to thread 2 (Thread 0x7ffff781c700 (LWP 13917))]
> > > 
> > > For Ada tasks, 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]
> > 
> > Except for Ada, the names are only available on some platforms,
> right?
> > Should we mention that in the manual?
> The manual currently describes the thread name and the way GDB
> shows the 'system thread name' only some systems in the command
> 'thread name' in the node 'Debugging Programs with Multiple Threads'.
> 
> What about the below addition ?
> 
> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index 9de56061d9..8361d68cef 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -3284,6 +3284,9 @@ disable printing of messages when @value{GDBN}
> notices that new threads have
>  started or that threads have exited.  By default, these messages will
>  be printed if detection of these events is supported by the target.
>  Note that these messages cannot be disabled on all targets.
> +The thread event message contains the thread name if @value{GDBN} can
> determine
> +its value by retrieving it from the OS or by using the thread name
> given by
> +the user (see @code{thread name}, above).
>  
>  @kindex show print thread-events
>  @item show print thread-events

Fine wirh me, thanks.
  

Patch

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 9de56061d9..8361d68cef 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -3284,6 +3284,9 @@  disable printing of messages when @value{GDBN} notices that new threads have
 started or that threads have exited.  By default, these messages will
 be printed if detection of these events is supported by the target.
 Note that these messages cannot be disabled on all targets.
+The thread event message contains the thread name if @value{GDBN} can determine
+its value by retrieving it from the OS or by using the thread name given by
+the user (see @code{thread name}, above).
 
 @kindex show print thread-events
 @item show print thread-events