This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Inadvertently run inferior threads
- From: Pedro Alves <palves at redhat dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: gdb at sourceware dot org
- Date: Sat, 14 Mar 2015 17:45:56 +0000
- Subject: Re: Inadvertently run inferior threads
- Authentication-results: sourceware.org; auth=none
- References: <83h9tq3zu3 dot fsf at gnu dot org> <55043A63 dot 6020103 at redhat dot com> <8361a339xd dot fsf at gnu dot org> <5504555C dot 804 at redhat dot com> <83385736qt dot fsf at gnu dot org> <55045E87 dot 4040100 at redhat dot com> <83y4mz1rlr dot fsf at gnu dot org> <5504608C dot 6090004 at redhat dot com> <83wq2j1pjw dot fsf at gnu dot org>
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