[PATCH 2/2] Send thread names to debugger

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Jul 29 13:58:00 GMT 2016


On Jul 29 14:17, Jon Turney wrote:
> On 28/07/2016 20:34, Corinna Vinschen wrote:
> > On Jul 28 12:43, Jon Turney wrote:
> > > GDB with the patch from [1] can report and use these names.
> > 
> > This is still WIP, right?
> 
> Yes, that's right.
> 
> > > --- a/winsup/cygwin/cygthread.cc
> > > +++ b/winsup/cygwin/cygthread.cc
> > > @@ -213,6 +213,8 @@ cygthread::create ()
> > >  			    this, 0, &id);
> > >        if (!htobe)
> > >  	api_fatal ("CreateThread failed for %s - %p<%y>, %E", __name, h, id);
> > > +      else
> > > +	SetThreadName(GetThreadId(htobe), __name);
> >                     ^^^         ^^^
> >                    space?      space?
> > 
> > Just wondering: Wouldn't it make sense to rename the internal threads
> > so they either always start with "cyg_" or with double underscore or
> > something like that to mark them as internal?  E.g.
> 
> Yeah, I wanted to do something like that.
> 
> But messing with the thread names may have other consequences (See
> fhandler_tty.cc:109), and I was a bit wary of introducing a malloc/free to
> into cygthread::create() to dynamically make the name with a "__" prepended

Ok.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20160729/be896a01/attachment.sig>


More information about the Cygwin-patches mailing list