Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFA: display thread names
Date: Wed, 12 Jan 2011 16:52:00 -0000	[thread overview]
Message-ID: <E1Pd3bp-0003Pm-Bn@fencepost.gnu.org> (raw)
In-Reply-To: <m3fwsygm4h.fsf@fleche.redhat.com> (message from Tom Tromey on	Wed, 12 Jan 2011 08:47:10 -0700)

> From: Tom Tromey <tromey@redhat.com>
> Date: Wed, 12 Jan 2011 08:47:10 -0700
> 
> When you have many threads, it is nice to be able to give them names to
> distinguish them.  This patch adds this facility via a new "thread name"
> command.  Also, on some systems a thread can give itself a name; this
> patch adds such support for Linux.

Is there a plan to add a possibility to switch to a thread by its
name, and otherwise use the name in the same context where we
currently allow only its number?  If there are no such plans, I'd say
having a name just for display is not a big deal it could be.

> 2011-01-12  Tom Tromey  <tromey@redhat.com>
> 
> 	* gdb.texinfo (Threads): Document thread name output and `thread
> 	name' command.
> 	(Threads In Python): Document Thread.name attribute.
> 	(GDB/MI Thread Commands): Document thread attributes.

This part is approved, with the following comment:

> +@smallexample
> +-thread-info
> +^done,threads=[
> +@{id="2",target-id="Thread 0xb7e14b90 (LWP 21257)",
> +   frame=@{level="0",addr="0xffffe410",func="__kernel_vsyscall",args=[]@},state="running"@},
> +@{id="1",target-id="Thread 0xb7e156b0 (LWP 21254)",
> +   frame=@{level="0",addr="0x0804891f",func="foo",args=[@{name="i",value="10"@}],
> +           file="/tmp/a.c",fullname="/tmp/a.c",line="158"@},state="running"@}],

The long lines in this example needs to be broken in two.  (Yes, I
know that you inherited that from the original example, but we might
as well fix that now.)

> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -15,6 +15,14 @@
>    It is like the "dir" command except that it replaces the
>    source path list instead of augmenting it.
>  
> +* GDB now understands thread names.
> +
> +  On GNU/Linux, "info threads" will display the thread name as set by
> +  prctl or pthread_setname_np.
> +
> +  There is also a new command, "thread name", which can be used to
> +  assign a name internally for GDB to display.
> +
>  * OpenCL C
>    Initial support for the OpenCL C language (http://www.khronos.org/opencl)
>    has been integrated into GDB.
> @@ -46,6 +54,9 @@
>    ** New function gdb.newest_frame returns the newest frame in the
>       selected thread.
>  
> +  ** The gdb.InferiorThread class has a new "name" attribute.  This
> +     holds the thread's name.
> +
>  * C++ Improvements:

This part is OK.

Thanks.


  reply	other threads:[~2011-01-12 16:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-12 16:11 Tom Tromey
2011-01-12 16:52 ` Eli Zaretskii [this message]
2011-01-18 22:49   ` Tom Tromey
2011-01-18 23:42     ` Eli Zaretskii
2011-01-19 15:26       ` Tom Tromey
2011-01-19 16:00         ` Eli Zaretskii
2011-01-14 18:42 ` Thiago Jung Bauermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1Pd3bp-0003Pm-Bn@fencepost.gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox