Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Ricard Wanderlof <ricard.wanderlof@axis.com>
To: Pat Pannuto <pat.pannuto@gmail.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Print thread name when executing thread commands
Date: Wed, 18 Sep 2013 07:04:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.00.1309180856200.2394@lnxricardw.se.axis.com> (raw)
In-Reply-To: <CA+Yp1NUTX7fQ4eq_LyGfR3JwRzOoEsT8dAFwX+WwFA9gaA22KQ@mail.gmail.com>


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  <pat.pannuto@gmail.com>

         * 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


  reply	other threads:[~2013-09-18  7:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-18  6:50 Pat Pannuto
2013-09-18  7:04 ` Ricard Wanderlof [this message]
2013-09-18 18:37   ` Pat Pannuto
2013-09-23 12:18     ` Agovic, Sanimir
2013-09-23 16:33       ` Pat Pannuto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.1309180856200.2394@lnxricardw.se.axis.com \
    --to=ricard.wanderlof@axis.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pat.pannuto@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox