Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Agovic, Sanimir" <sanimir.agovic@intel.com>
To: "'pat.pannuto@gmail.com'" <pat.pannuto@gmail.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH] Print thread name when executing thread commands
Date: Mon, 23 Sep 2013 12:18:00 -0000	[thread overview]
Message-ID: <0377C58828D86C4588AEEC42FC3B85A717680F5D@IRSMSX105.ger.corp.intel.com> (raw)
In-Reply-To: <CA+Yp1NUY9CWW3L7U8D-hj7q4RLfgxJB9g4-YdDrF+US3=nfdsg@mail.gmail.com>

Hello Pat,

please have a look at https://sourceware.org/ml/gdb-patches/2013-09/msg00485.html

A question below.

-Sanimir

> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.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
> 
> $ cat print_thread_names.diff
> Index: gdb/thread.c
> ===================================================================
> 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 = 0; k != i; k++)
>          if (thread_alive (tp_array[k]))
>            {
> +            char *name;
>              switch_to_thread (tp_array[k]->ptid);
> -            printf_filtered (_("\nThread %d (%s):\n"),
> +            name = 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 
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


  reply	other threads:[~2013-09-23 12:18 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
2013-09-18 18:37   ` Pat Pannuto
2013-09-23 12:18     ` Agovic, Sanimir [this message]
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=0377C58828D86C4588AEEC42FC3B85A717680F5D@IRSMSX105.ger.corp.intel.com \
    --to=sanimir.agovic@intel.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