From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24621 invoked by alias); 18 Sep 2013 07:04:36 -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 24601 invoked by uid 89); 18 Sep 2013 07:04:35 -0000 Received: from ra.se.axis.com (HELO ra.se.axis.com) (195.60.68.13) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Sep 2013 07:04:35 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL,BAYES_20,KHOP_THREADED,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: ra.se.axis.com Received: from localhost (localhost [127.0.0.1]) by ra.se.axis.com (Postfix) with ESMTP id 3D97D11DEA; Wed, 18 Sep 2013 09:04:31 +0200 (CEST) Received: from ra.se.axis.com ([127.0.0.1]) by localhost (ra.se.axis.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id QD8PcsjecUUU; Wed, 18 Sep 2013 09:04:29 +0200 (CEST) Received: from boulder.se.axis.com (boulder.se.axis.com [10.0.2.104]) by ra.se.axis.com (Postfix) with ESMTP id E103C11FAB; Wed, 18 Sep 2013 09:04:25 +0200 (CEST) Received: from boulder.se.axis.com (localhost [127.0.0.1]) by postfix.imss71 (Postfix) with ESMTP id CAF5894C; Wed, 18 Sep 2013 09:04:25 +0200 (CEST) Received: from seth.se.axis.com (seth.se.axis.com [10.0.2.172]) by boulder.se.axis.com (Postfix) with ESMTP id BFD02928; Wed, 18 Sep 2013 09:04:25 +0200 (CEST) Received: from xmail2.se.axis.com (xmail2.se.axis.com [10.0.5.74]) by seth.se.axis.com (Postfix) with ESMTP id BDC143E070; Wed, 18 Sep 2013 09:04:25 +0200 (CEST) Received: from lnxricardw.se.axis.com (10.88.7.1) by xmail2.se.axis.com (10.0.5.74) with Microsoft SMTP Server (TLS) id 8.2.255.0; Wed, 18 Sep 2013 09:04:25 +0200 Date: Wed, 18 Sep 2013 07:04:00 -0000 From: Ricard Wanderlof To: Pat Pannuto CC: "gdb-patches@sourceware.org" Subject: Re: [PATCH] Print thread name when executing thread commands In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: 8BIT X-SW-Source: 2013-09/txt/msg00564.txt.bz2 On Wed, 18 Sep 2013, Pat Pannuto wrote: > Currently the thread family of commands only prints the thread ID and > PID. GDB also has access to the thread's name, which is often an easier > way of quickly identifying a thread. This simple patch uses the same > mechanism as `info threads' to get the name of a thread and add it to > the thread identifier line when it's printed. > > I wrapped the name in []'s to offset it and make it visually distinct > from the ()'s that wrap the other thread information. I'm not at all > attached to this look, just looked best to me. > > Diff should be from current cvs. This is my first patch to GDB, if I > messed something up don't hesitate to yell at me. I'm fairly new here too so maybe I shouldn't say too much, but supplying the patch inline (including the ChangeLog entry) in the post makes it much easier to comment on it. I still like adding it as an attachement lest the mail program messes up the formatting so it doesn't apply. My initial comment is that the ChangeLog format requires that it should be more specific regarding which functions have been modified. One should be able to grep for the function name in the ChangeLog. Something like 2013-09-18 Pat Pannuto * thread.c (thread_apply_all_command, thread_apply_command): Print thread name as well as ID number and PID. In the code, there was a 'char *name' in one place, but 'char* name' in another. Looking quickly, the indentation of multiple-line statements looked inconsistent in some places too. As for the functionality itself, I'm not in a position to approve but I think it's a good idea. It's annoying just to get the thread id when there's more information available. I don't know if there are any caveats. /Ricard -- Ricard Wolf Wanderlöf ricardw(at)axis.com Axis Communications AB, Lund, Sweden www.axis.com Phone +46 46 272 2016 Fax +46 46 13 61 30