From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19319 invoked by alias); 23 Sep 2013 12:18:32 -0000 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 Received: (qmail 19298 invoked by uid 89); 23 Sep 2013 12:18:31 -0000 Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Sep 2013 12:18:31 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_20,RDNS_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mga03.intel.com Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 23 Sep 2013 05:18:28 -0700 X-ExtLoop1: 1 Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by azsmga001.ch.intel.com with ESMTP; 23 Sep 2013 05:18:27 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.29]) by IRSMSX102.ger.corp.intel.com ([169.254.2.234]) with mapi id 14.03.0123.003; Mon, 23 Sep 2013 13:18:25 +0100 From: "Agovic, Sanimir" To: "'pat.pannuto@gmail.com'" CC: "gdb-patches@sourceware.org" Subject: RE: [PATCH] Print thread name when executing thread commands Date: Mon, 23 Sep 2013 12:18:00 -0000 Message-ID: <0377C58828D86C4588AEEC42FC3B85A717680F5D@IRSMSX105.ger.corp.intel.com> References: In-Reply-To: Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00816.txt.bz2 Hello Pat, please have a look at https://sourceware.org/ml/gdb-patches/2013-09/msg0048= 5.html A question below. -Sanimir > -----Original Message----- > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourcewa= re.org] On Behalf > Of Pat Pannuto > Sent: Wednesday, September 18, 2013 08:37 PM > To: Ricard Wanderlof > Cc: gdb-patches@sourceware.org > Subject: Re: [PATCH] Print thread name when executing thread commands >=20 > $ cat print_thread_names.diff > Index: gdb/thread.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvs/src/src/gdb/thread.c,v > retrieving revision 1.157 > diff -u -p -r1.157 thread.c > --- gdb/thread.c 17 Sep 2013 18:26:39 -0000 1.157 > +++ gdb/thread.c 18 Sep 2013 18:31:15 -0000 > @@ -1255,10 +1255,14 @@ thread_apply_all_command (char *cmd, int > for (k =3D 0; k !=3D i; k++) > if (thread_alive (tp_array[k])) > { > + char *name; > switch_to_thread (tp_array[k]->ptid); > - printf_filtered (_("\nThread %d (%s):\n"), > + name =3D tp_array[k]->name ? tp_array[k]->name > + : target_thread_name (tp_array[k]); > What happens if a thread changes its name during execution, do we get the=20 cached or the actual thread name? It looks to me as we should never directly access the thread_info::name member, or? Btw, a testcase would be great. Intel GmbH Dornacher Strasse 1 85622 Feldkirchen/Muenchen, Deutschland Sitz der Gesellschaft: Feldkirchen bei Muenchen Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk Registergericht: Muenchen HRB 47456 Ust.-IdNr./VAT Registration No.: DE129385895 Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052