Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Give thread names in thread events, give Ada task names in more output.
Date: Mon, 03 Jun 2019 20:02:00 -0000	[thread overview]
Message-ID: <87imtml9o6.fsf@tromey.com> (raw)
In-Reply-To: <20190518182306.22937-1-philippe.waroquiers@skynet.be> (Philippe	Waroquiers's message of "Sat, 18 May 2019 20:23:06 +0200")

>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:

Philippe> With this patch, we e.g. get:
Philippe>   [New Thread 0x7ffff701b700 (LWP 13891) "sleepers"]
Philippe>   [Switching to thread 2 (Thread 0x7ffff781c700 (LWP 13890) "sleepers")]
Philippe> instead of:
Philippe>   [New Thread 0x7ffff701b700 (LWP 13918)]
Philippe>   [Switching to thread 2 (Thread 0x7ffff781c700 (LWP 13917))]

Thanks.  I'm mildly surprised this works at thread-announce time, since
I thought the thread had to be created before it could be given a name.
Maybe it is racy?  (FWIW it is fine if it is.)  Or maybe I'm mistaken
and there's a way to name a thread before pthread_create.

Philippe> +/* Return the string to display e.g. in "info threads"'s "Target Id"
Philippe> +   column, for TP.  */
Philippe> +
Philippe> +std::string
Philippe> +thread_target_id_str (thread_info *tp);

This should be "extern std::string thread_target_id_str (...);".

However, could this just be a method on thread_info?  I think that would
be preferable.  I think it's not much more work.

Philippe> -			   target_pid_to_str (lp->ptid).c_str ());
Philippe> +			   thread_target_id_str (th).c_str ());

Are there spots calling target_pid_to_str that do not want to call the
new function?

thanks,
Tom


  parent reply	other threads:[~2019-06-03 20:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-18 18:23 Philippe Waroquiers
2019-05-18 19:03 ` Eli Zaretskii
2019-05-19 12:41   ` Philippe Waroquiers
2019-05-19 13:32     ` Eli Zaretskii
2019-06-03 20:02 ` Tom Tromey [this message]
2019-06-04 21:40   ` Philippe Waroquiers
2019-06-05 13:28     ` Tom Tromey
2019-06-05  9:02 ` Pedro Alves
2019-06-05 22:24   ` Philippe Waroquiers
2019-06-08 15:45   ` Philippe Waroquiers

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=87imtml9o6.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=philippe.waroquiers@skynet.be \
    /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