Re: Inadvertently run inferior threads

Pedro Alves <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
On 03/14/2015 05:01 PM, Eli Zaretskii wrote:
>> From: Pedro Alves <[email protected]>

>>> Well, Windows threads don't really have names, AFAIK.
>>
>> Last I looked, Visual Studio does support that.  It's based on a
>> funny hack:
>>
>>  https://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx
> 
> That's only for viewing thread names in a debugger.  Is that what
> target_thread_name hook does?

It retrieves the thread's name from the target, for display
and whatever else we might give it a use for in the future.
It's a convenience thing for the user.  On GNU/Linux, a user
can call pthread_setname_np to set the name in the program,
and then GDB can display the name in "info threads", for easier
thread identification.  I found that useful in the
attach-many-short-lived-threads test, for example.

Currently it's shown in "info threads", and also used
in "thread find".  That is, you can use "thread find foo" to
find the thread named "foo".

-- 
Pedro Alves
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.