From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: Pedro Alves <palves@redhat.com>, 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 22:24:00 -0000 [thread overview]
Message-ID: <1559773451.1454.57.camel@skynet.be> (raw)
In-Reply-To: <592e4423-0204-607f-3165-60aa0a3b4652@redhat.com>
On Wed, 2019-06-05 at 10:02 +0100, Pedro Alves wrote:
> 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.
Pedro and Tom,
Thanks for the feedback and suggestions.
I will see how to go on with this.
Maybe the best is to do this in 3 different patches:
* a patch adding the Ada task name where relevant
* a patch adding in the thread events the thread name
and the other things suggested by Pedro
* a third patch that replaces (where relevant) target_pid_to_str
by something like target_pid_to_thr_id_str
Philippe
next prev parent reply other threads:[~2019-06-05 22:24 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
2019-06-05 22:24 ` Philippe Waroquiers [this message]
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=1559773451.1454.57.camel@skynet.be \
--to=philippe.waroquiers@skynet.be \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.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