From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20261 invoked by alias); 14 Mar 2015 17:46:03 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 20250 invoked by uid 89); 14 Mar 2015 17:46:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 14 Mar 2015 17:46:01 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2EHjwqr024205 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 14 Mar 2015 13:45:58 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2EHjuUW028466; Sat, 14 Mar 2015 13:45:57 -0400 Message-ID: <550473D4.1030802@redhat.com> Date: Sat, 14 Mar 2015 17:46:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Eli Zaretskii CC: gdb@sourceware.org Subject: Re: Inadvertently run inferior threads References: <83h9tq3zu3.fsf@gnu.org> <55043A63.6020103@redhat.com> <8361a339xd.fsf@gnu.org> <5504555C.804@redhat.com> <83385736qt.fsf@gnu.org> <55045E87.4040100@redhat.com> <83y4mz1rlr.fsf@gnu.org> <5504608C.6090004@redhat.com> <83wq2j1pjw.fsf@gnu.org> In-Reply-To: <83wq2j1pjw.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-03/txt/msg00042.txt.bz2 On 03/14/2015 05:01 PM, Eli Zaretskii wrote: >> From: Pedro Alves >>> 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