This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Inadvertently run inferior threads


On 03/14/2015 05:01 PM, Eli Zaretskii wrote:
>> From: Pedro Alves <palves@redhat.com>

>>> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]