From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFAv2] Output the Ada task name in more messages, output task names between "".
Date: Wed, 14 Aug 2019 22:08:00 -0000 [thread overview]
Message-ID: <6185768b61d65d73514844b41aa9ba4861051c9f.camel@skynet.be> (raw)
In-Reply-To: <87imqzveli.fsf@tromey.com>
On Wed, 2019-08-14 at 11:31 -0600, Tom Tromey wrote:
> > > > > > "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:
>
> Philippe> So, I can either rollback the addition of quotes, or (slightly) cleanup
> Philippe> the code above.
> Philippe> What do you prefer ?
> Philippe> (or any other suggestion about how to do quotes cleanly?).
>
> What do you think of using quotes in most places, but not in "info tasks"?
IMO, using the same convention everywhere for a task name (i.e. using quotes)
and the same convention as thread name is a nice thing to have.
That e.g. gives the below, where thread and task names have now the same
representation.
(gdb) info threads
Id Target Id Frame
1 Thread 0x7ffff79eb740 (LWP 6164) "foo" futex_wait_cancelable (
private=0, expected=0, futex_word=0x55555555e3f4)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
2 Thread 0x7ffff79ea700 (LWP 6203) "task_list(1)" foo.break_me ()
at /bd/home/philippe/gdb/git/pipe/gdb/testsuite/gdb.ada/tasks/foo.adb:27
* 3 Thread 0x7ffff77e5700 (LWP 6205) "task_list(2)" futex_wait_cancelable (
private=0, expected=0, futex_word=0x555555562964)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
4 Thread 0x7ffff75e0700 (LWP 6207) "task_list(3)" futex_wait_cancelable (
private=0, expected=0, futex_word=0x5555555660e4)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
(gdb) info task
ID TID P-ID Pri State Name
1 55555555e280 48 Waiting on RV with 2 "main_task"
2 55555555f070 1 48 Accepting RV with 1 "task_list(1)"
* 3 5555555627f0 1 48 Accept or Select Term "task_list(2)"
4 555555565f70 1 48 Accept or Select Term "task_list(3)"
(gdb)
This is IMO worth having the "if" on is_mi_like_p.
The code can be made somewhat cleaner like the below:
+ /* Finally, print the task name, without quotes for mi like. */
+ {
+ const char *opt_quote = (uiout->is_mi_like_p () ? "" : "\"");
+
+ uiout->field_fmt ("name",
+ "%s%s%s",
+ opt_quote,
+ task_info->name[0] != '\0' ? task_info->name
+ : _("<no name>"),
+ opt_quote);
+ }
I have fixed the other comments.
Thanks for the review,
Philippe
prev parent reply other threads:[~2019-08-14 22:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-04 15:11 Philippe Waroquiers
2019-08-04 16:23 ` Eli Zaretskii
2019-08-13 21:00 ` Tom Tromey
2019-08-14 4:56 ` Philippe Waroquiers
2019-08-14 17:31 ` Tom Tromey
2019-08-14 22:08 ` Philippe Waroquiers [this message]
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=6185768b61d65d73514844b41aa9ba4861051c9f.camel@skynet.be \
--to=philippe.waroquiers@skynet.be \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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