Inadvertently run inferior threads
Pedro Alves
palves@redhat.com
Sat Mar 14 17:46:00 GMT 2015
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
More information about the Gdb
mailing list