public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* RE: [RFC] named thread support
@ 2005-10-06 12:34 Kris Warkentin
  0 siblings, 0 replies; 11+ messages in thread
From: Kris Warkentin @ 2005-10-06 12:34 UTC (permalink / raw)
  To: 'Daniel Jacobowitz', Kris Warkentin; +Cc: GDB

> On Tue, Oct 04, 2005 at 12:40:22PM -0400, Kris Warkentin wrote:
> > Would it be of interest to have a generic 'set threadname 
> <tid> <name>' 
> > that called a target_set_threadname()?  I ask because we're 
> implementing 
> > named threads in our kernel but I don't know if many other systems 
> > support this.  I can always add it to our backend but if 
> someone else 
> > might use it in the future, I can make it general.
> 
> So by named thread support, you mean that the application can register
> the name of the thread with the kernel?  And you want GDB to 
> be able to set thread names?

Exactly.  When I implemented the reading of the names from the target it
occurred to me that I could set names as well.  It's not a super useful or
high priority item but it's easy and fun so I thought I'd do it anyway. ;-)

> I recommend doing this in your backend, since I don't know any other
> gdb-supported system with a similar feature.

No problem.

cheers,

Kris

^ permalink raw reply	[flat|nested] 11+ messages in thread
* RE: [RFC] named thread support
@ 2005-10-07 16:53 Kris Warkentin
  0 siblings, 0 replies; 11+ messages in thread
From: Kris Warkentin @ 2005-10-07 16:53 UTC (permalink / raw)
  To: 'Daniel Jacobowitz', Stan Shebs; +Cc: Kris Warkentin, GDB

> -----Original Message-----
> From: Daniel Jacobowitz [mailto:drow@false.org]
> On Thu, Oct 06, 2005 at 11:30:22AM -0700, Stan Shebs wrote:
> > Kris Warkentin wrote:
> > 
> > >Would it be of interest to have a generic 'set threadname <tid> 
> > ><name>' that called a target_set_threadname()?  I ask 
> because we're 
> > >implementing named threads in our kernel but I don't know if many 
> > >other systems support this.  I can always add it to our 
> backend but if 
> > >someone else might use it in the future, I can make it general.
> > 
> > This actually was on the wishlist ages ago, ca 1998 or so I think,
> > probably connected with eCos plans. Even a target that didn't
> > support named threads could still make use of the generic 
> capability,
> > for instance via setup scripts - break at a place known unique to a
> > particular thread, get tid, name it, then user and other scripts can
> > reliably use the name.
> 
> I find this much more interesting than the way I interpreted Kris's
> original question - I don't think many targets will be interested in
> propogating the thread name to the target, but more will be interested
> in retrieving the thread name from the target, and all will be
> interested in user-defined names in the interface.  Let's do it! :-)

Cool.  We're putting another person on our gdb team (Jeff Baker who you
might know from the binutils mailing list) so he and I will work on this.
Sounds like a fun project.

cheers,

Kris

^ permalink raw reply	[flat|nested] 11+ messages in thread
* re: [RFC] named thread support
@ 2005-10-06 17:40 Kris Warkentin
  0 siblings, 0 replies; 11+ messages in thread
From: Kris Warkentin @ 2005-10-06 17:40 UTC (permalink / raw)
  To: 'Michael Snyder', gdb

> Daniel Jacobowitz <drow at false dot org> wrote:
> >On Tue, Oct 04, 2005 at 12:40:22PM -0400, Kris Warkentin wrote:
> >> Would it be of interest to have a generic 'set threadname 
> <tid> <name>'
> >> that called a target_set_threadname()?  I ask because 
> we're implementing
> >> named threads in our kernel but I don't know if many other systems
> >> support this.  I can always add it to our backend but if 
> someone else
> >> might use it in the future, I can make it general.
> >
> > So by named thread support, you mean that the application 
> can register
> > the name of the thread with the kernel?  And you want GDB 
> to be able to
> > set thread names?
> >
> > I recommend doing this in your backend, since I don't know any other
> > gdb-supported system with a similar feature.
> 
> On the other hand, this is not the first time I have heard
> the idea put forth.  Evidently at least some people want
> to be able to associate a name with a thread.
> 
> For the sake of discussion, what about this?  Split it into
> a generic part and a target-specific part.
> 
> 1) The generic part would be to add a name field to gdb's
> thread struct, with appropriate UI for manipulating and
> displaying it.  The "thread" and "thread apply" commands
> would be enhanced to accept a name as well as a number.

I actually hadn't thought of doing it this way but that's a good idea.  I'm
using the private_thread_info structure to hold the thread names but if it
were part of the higher level thread structure, it would simplify the
backend code.
 
> 2) Target-specific part -- sends the gdb-selected names
> to the target, accepts target-selected names from the target
> and adds them to gdb thread database.

Good idea.

cheers,

Kris

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [RFC] named thread support
@ 2005-10-06 15:23 Michael Snyder
  2005-10-06 17:23 ` Ramana Radhakrishnan
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Snyder @ 2005-10-06 15:23 UTC (permalink / raw)
  To: gdb

Daniel Jacobowitz <drow at false dot org> wrote:
>On Tue, Oct 04, 2005 at 12:40:22PM -0400, Kris Warkentin wrote:
>> Would it be of interest to have a generic 'set threadname <tid> <name>'
>> that called a target_set_threadname()?  I ask because we're implementing
>> named threads in our kernel but I don't know if many other systems
>> support this.  I can always add it to our backend but if someone else
>> might use it in the future, I can make it general.
>
> So by named thread support, you mean that the application can register
> the name of the thread with the kernel?  And you want GDB to be able to
> set thread names?
>
> I recommend doing this in your backend, since I don't know any other
> gdb-supported system with a similar feature.

On the other hand, this is not the first time I have heard
the idea put forth.  Evidently at least some people want
to be able to associate a name with a thread.

For the sake of discussion, what about this?  Split it into
a generic part and a target-specific part.

1) The generic part would be to add a name field to gdb's
thread struct, with appropriate UI for manipulating and
displaying it.  The "thread" and "thread apply" commands
would be enhanced to accept a name as well as a number.

2) Target-specific part -- sends the gdb-selected names
to the target, accepts target-selected names from the target
and adds them to gdb thread database.

Part 1 could be used by everybody, independently of
whether their target implements part 2.

Michael


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [RFC] named thread support
@ 2005-10-04 16:40 Kris Warkentin
  2005-10-06  1:21 ` Daniel Jacobowitz
  2005-10-06 18:30 ` Stan Shebs
  0 siblings, 2 replies; 11+ messages in thread
From: Kris Warkentin @ 2005-10-04 16:40 UTC (permalink / raw)
  To: GDB

Would it be of interest to have a generic 'set threadname <tid> <name>' 
that called a target_set_threadname()?  I ask because we're implementing 
named threads in our kernel but I don't know if many other systems 
support this.  I can always add it to our backend but if someone else 
might use it in the future, I can make it general.

cheers,

Kris

-- 
Stay up-to-date on all the QNX news!  Register at
http://www.qnx.com/news/forms/newsletter.html to
receive our newsletter.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-10-09 20:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-06 12:34 [RFC] named thread support Kris Warkentin
  -- strict thread matches above, loose matches on Subject: below --
2005-10-07 16:53 Kris Warkentin
2005-10-06 17:40 Kris Warkentin
2005-10-06 15:23 Michael Snyder
2005-10-06 17:23 ` Ramana Radhakrishnan
2005-10-04 16:40 Kris Warkentin
2005-10-06  1:21 ` Daniel Jacobowitz
2005-10-09 20:35   ` Mark Kettenis
2005-10-09 20:40     ` Daniel Jacobowitz
2005-10-06 18:30 ` Stan Shebs
2005-10-07 15:14   ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).