This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [PATCH] Add pthread_getname_np, pthread_setname_np
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Fri, 24 Feb 2012 10:38:09 +0100
- Subject: Re: [PATCH] Add pthread_getname_np, pthread_setname_np
- References: <1330054695.6828.15.camel@YAAKOV04>
- Reply-to: cygwin-patches at cygwin dot com
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