public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH] Add pthread_getname_np, pthread_setname_np
Date: Fri, 24 Feb 2012 09:38:00 -0000	[thread overview]
Message-ID: <20120224093809.GA20683@calimero.vinschen.de> (raw)
In-Reply-To: <1330054695.6828.15.camel@YAAKOV04>

On Feb 23 21:38, Yaakov (Cygwin/X) wrote:
> This patchset adds pthread_getname_np and pthread_setname_np.  These
> were added to glibc in 2.12[1] and are also present in some form on
> NetBSD and several UNIXes.  IIUC recent versions of GDB can benefit from
> this support.

Thanks for your patch, but I don't think it's the whole thing.

Consider, if you implement pthread_[gs]etname_np as you did, then you
have pthread names which are only available to the process in which
the threads are running.  So, how could GDB get the information for
its inferior process?

Actually GDB reads the thread name using a target specific function
which is so far only implemented for Linux.  It does not use
pthread_getname_np, rather it reads the name from /proc/$PID/task/$TID/comm.

And that's a bit of a problem in Cygwin.  Every Cygwin process is
multi-threaded (think signals), but only the application-started threads
are pthreads.

So, again, thanks for doing this, but I think this requires more work to
be useful.  The basic task is to provide /proc/$PID/task for all threads
running in a Cygwin process.  If that's available, the pthread_[gs]etname_np
will become useful and their (different) implementation probably falls into
place.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

  reply	other threads:[~2012-02-24  9:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-24  3:38 Yaakov (Cygwin/X)
2012-02-24  9:38 ` Corinna Vinschen [this message]
2012-02-24 11:00   ` Yaakov (Cygwin/X)
2012-02-24 12:18     ` Corinna Vinschen
2012-02-24 16:56       ` Pedro Alves

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=20120224093809.GA20683@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin-patches@cygwin.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).