Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Philippe Waroquiers <philippe.waroquiers@skynet.be>,
	gdb-patches@sourceware.org
Subject: Re: [RFA] Give thread names in thread events, give Ada task names in more output.
Date: Wed, 05 Jun 2019 09:02:00 -0000	[thread overview]
Message-ID: <592e4423-0204-607f-3165-60aa0a3b4652@redhat.com> (raw)
In-Reply-To: <20190518182306.22937-1-philippe.waroquiers@skynet.be>

On 5/18/19 7:23 PM, Philippe Waroquiers wrote:
> With this patch, we e.g. get:
>   [New Thread 0x7ffff701b700 (LWP 13891) "sleepers"]
>   [Switching to thread 2 (Thread 0x7ffff781c700 (LWP 13890) "sleepers")]
> instead of:
>   [New Thread 0x7ffff701b700 (LWP 13918)]
>   [Switching to thread 2 (Thread 0x7ffff781c700 (LWP 13917))]
> 
> For Ada tasks, we e.g. get:
>   [Switching to task 2 task_list(1)]
>   [Current task is 2 task_list(1)]
> instead of
>   [Switching to task 2]
>   [Current task is 2]

BTW, if you're looking at improving this, take a look what I was
proposing here:

  https://sourceware.org/ml/gdb-patches/2019-04/msg00448.html

 (gdb) r
 Starting program: build/gdb/testsuite/outputs/gdb.threads/schedlock/schedlock 
 [Thread debugging using libthread_db enabled]
 Using host libthread_db library "/lib64/libthread_db.so.1".
 [Thread 1.2 (0x7ffff74b8700 (LWP 13984) "sleepers") appeared]
 [Thread 1.2 (0x7ffff74b8700 (LWP 13984) "sleepers") exited]
 [Inferior 1 (process 13980) exited normally]
 (gdb)

Specifically, I think it'd be quite useful to show the thread's
gdb number.  I'd say that is more useful than the thread name, even,
because you can use "info threads" to find the name from the unique
gdb id, but converse isn't so easy.

> @@ -986,10 +986,9 @@ should_print_thread (const char *requested_threads, int default_inf_num,
>    return 1;
>  }
>  
> -/* Return the string to display in "info threads"'s "Target Id"
> -   column, for TP.  */
> +/* See gdbthread.h.  */
>  
> -static std::string
> +std::string
>  thread_target_id_str (thread_info *tp)
>  {

The commit's description talks about thread names, but
note that thread_target_id_str prints more than the name -- it also
prints the thread's extra info.

Thanks,
Pedro Alves


  parent reply	other threads:[~2019-06-05  9: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
2019-06-04 21:40   ` Philippe Waroquiers
2019-06-05 13:28     ` Tom Tromey
2019-06-05  9:02 ` Pedro Alves [this message]
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=592e4423-0204-607f-3165-60aa0a3b4652@redhat.com \
    --to=palves@redhat.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