Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Karen Osmond <karen.osmond@gmail.com>
To: Tom Tromey <tromey@redhat.com>
Cc: karen.osmond@gmail.com, gdb-patches@sourceware.org
Subject: Re: [rfc][patch] Allow GDB to display user-defined thread names
Date: Mon, 08 Jun 2009 14:24:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.0906081431150.32368@localhost.localdomain> (raw)
In-Reply-To: <m3d49is4ar.fsf@fleche.redhat.com>

On Fri, 5 Jun 2009, Tom Tromey wrote:
> >>>>> "Karen" == Karen Osmond <karen.osmond@gmail.com> writes:
> Karen> The new gdb command takes the form "thread name NAME" and
> Karen> associates NAME with the current thread, so you can issue
> Karen> something like:
> 
> It seems like a nice idea to me.  As J.T. says, it would be nice to
> have this automatically work for targets that define a thread name --

Yup, I'll try to find out a bit more about those posix thread extensions.  
Also, I think the Windows way involves throwing a particular exception to 
get the thread name into the debugger, and it looks like gdb doesn't 
support that currently (though i only had a very cursory browse for it).

> but I think it is ok to build up the feature piecemeal.

I'll leave the above and python and MI for now...

> Karen> So, if this is of interest, I'd like to spend the time to improve it but 
> Karen> if anybody has time, it would be of great help if a gdb bod could 
> Karen> volunteer to mentor me a bit... please? :)
> 
> Sure.

Wonderful, thank you!

> Actually, it seems to me that the name-printing should be done by some
> generic code, not in linux-thread-db.c.

Yes, true... and stepping back a level, adding it to target_pid_to_str 
seems wrong also.  Perhaps it is best to make a new function to print the 
thread's id, name and pid_to_str stuff and to call that from the 
appropriate places in thread.c, such as after the thread id in "thread 
info" output.  I think it is also helpful in a few other places like 
[Switching to...] and [New...] and [... exited].  Those don't currently 
include the thread id, but perhaps it makes sense to add that as well (I 
spotted a FIXME-implementors in the manual to that effect, at least for 
[New...]).
 
> One important missing piece is an update to the manual.
> All new user commands require documentation.

I'll make sure to include that in the next patch.

cheers,
-karen


      parent reply	other threads:[~2009-06-08 14:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-04 16:43 Karen Osmond
2009-06-04 16:52 ` J.T. Conklin
2009-06-05 22:29 ` Tom Tromey
2009-06-05 22:43   ` Paul Pluzhnikov
2009-06-08 14:24   ` Karen Osmond [this message]

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=Pine.LNX.4.64.0906081431150.32368@localhost.localdomain \
    --to=karen.osmond@gmail.com \
    --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