From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26158 invoked by alias); 12 Jan 2011 16:31:57 -0000 Received: (qmail 26138 invoked by uid 22791); 12 Jan 2011 16:31:54 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Jan 2011 16:31:47 +0000 Received: from eliz by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1Pd3bp-0003Pm-Bn; Wed, 12 Jan 2011 11:31:41 -0500 From: Eli Zaretskii To: Tom Tromey CC: gdb-patches@sourceware.org In-reply-to: (message from Tom Tromey on Wed, 12 Jan 2011 08:47:10 -0700) Subject: Re: RFA: display thread names Reply-to: Eli Zaretskii References: Message-Id: Date: Wed, 12 Jan 2011 16:52:00 -0000 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-01/txt/msg00264.txt.bz2 > From: Tom Tromey > Date: Wed, 12 Jan 2011 08:47:10 -0700 > > When you have many threads, it is nice to be able to give them names to > distinguish them. This patch adds this facility via a new "thread name" > command. Also, on some systems a thread can give itself a name; this > patch adds such support for Linux. Is there a plan to add a possibility to switch to a thread by its name, and otherwise use the name in the same context where we currently allow only its number? If there are no such plans, I'd say having a name just for display is not a big deal it could be. > 2011-01-12 Tom Tromey > > * gdb.texinfo (Threads): Document thread name output and `thread > name' command. > (Threads In Python): Document Thread.name attribute. > (GDB/MI Thread Commands): Document thread attributes. This part is approved, with the following comment: > +@smallexample > +-thread-info > +^done,threads=[ > +@{id="2",target-id="Thread 0xb7e14b90 (LWP 21257)", > + frame=@{level="0",addr="0xffffe410",func="__kernel_vsyscall",args=[]@},state="running"@}, > +@{id="1",target-id="Thread 0xb7e156b0 (LWP 21254)", > + frame=@{level="0",addr="0x0804891f",func="foo",args=[@{name="i",value="10"@}], > + file="/tmp/a.c",fullname="/tmp/a.c",line="158"@},state="running"@}], The long lines in this example needs to be broken in two. (Yes, I know that you inherited that from the original example, but we might as well fix that now.) > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -15,6 +15,14 @@ > It is like the "dir" command except that it replaces the > source path list instead of augmenting it. > > +* GDB now understands thread names. > + > + On GNU/Linux, "info threads" will display the thread name as set by > + prctl or pthread_setname_np. > + > + There is also a new command, "thread name", which can be used to > + assign a name internally for GDB to display. > + > * OpenCL C > Initial support for the OpenCL C language (http://www.khronos.org/opencl) > has been integrated into GDB. > @@ -46,6 +54,9 @@ > ** New function gdb.newest_frame returns the newest frame in the > selected thread. > > + ** The gdb.InferiorThread class has a new "name" attribute. This > + holds the thread's name. > + > * C++ Improvements: This part is OK. Thanks.