From: Pedro Alves <palves@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: ui_out format strings for fields and styles (Re: [PATCH] Style "pwd" output)
Date: Thu, 06 Jun 2019 15:49:00 -0000 [thread overview]
Message-ID: <bfe38994-04d9-23c5-bc88-084db221fc48@redhat.com> (raw)
In-Reply-To: <87imtjbrmx.fsf@tromey.com>
On 6/5/19 11:21 PM, Tom Tromey wrote:
>>> We could just remove the enum, move to passing pointers everywhere, and
>>> convert the *_style objects to be pointers. This would streamline
>>> things a bit;
>
> Pedro> ...
>
>>> and we could use nullptr to mean "keep the default".
>
> Pedro> Yeah, that would %pN / %p] redundant/unnecessary...
>
> I didn't go quite as far as making everything take pointers, partly
> because it made it harder to preserve the distinction between the CLI
> layer and the ui-file styling layer. So instead I just removed the
> enum.
>
> My patch also removes (really just comments out) %pS and %pN in favor of
> requiring %ps. Those could be restored with a bit of effort I guess.
Yes, I think so. I think the main issue is that cli_style_option::style()
returns a new temporary ui_file_style, so we can't take its address, like in:
current_uiout->message (_("Reading symbols from %pS%s%pS...\n"),
&file_name_style.style (), name, nullptr);
But that could be fixed by adding a m_style field to cli_style_option,
and making cli_style_option::style() return a const reference to that.
We'd either need to make cli_style_option register set command hooks
to update that m_size variable whenever the users changes the corresponding
foreground/background setting, or always update m_style when
cli_style_option::style() is called.
>
> Pedro> If you'd like to give this a try, please do feel free to push to
> Pedro> the branch.
>
> I didn't push but my patch is appended. Let me know what you think. I
> can push tomorrow if you want it. I'm not sure now if what remains of
> the patch is a good idea or not; or if moving fully to pointers would be
> better.
>
Please push. I don't know either, but undoing a patch on a branch is
simple enough if we find that we want to do that. :-)
Thanks,
Pedro Alves
next prev parent reply other threads:[~2019-06-06 15:49 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-05 2:01 [PATCH] Style "pwd" output Tom Tromey
2019-06-05 8:36 ` Pedro Alves
2019-06-05 13:42 ` Tom Tromey
2019-06-05 15:21 ` Pedro Alves
2019-06-05 18:12 ` ui_out format strings for fields and styles (Re: [PATCH] Style "pwd" output) Pedro Alves
2019-06-05 20:27 ` Tom Tromey
2019-06-05 20:39 ` Pedro Alves
2019-06-05 20:42 ` Pedro Alves
2019-06-05 20:49 ` Tom Tromey
2019-06-05 20:47 ` Tom Tromey
2019-06-05 21:25 ` Pedro Alves
2019-06-05 22:21 ` Tom Tromey
2019-06-06 15:49 ` Pedro Alves [this message]
2019-06-06 23:55 ` Tom Tromey
2019-06-07 18:27 ` Tom Tromey
2019-06-07 19:20 ` Tom Tromey
2019-07-01 12:23 ` Pedro Alves
2019-07-01 12:55 ` Pedro Alves
2019-07-01 13:06 ` Pedro Alves
2019-07-01 17:26 ` Tom Tromey
2019-07-01 19:24 ` [users/palves/format_strings] Down with .ptr() (Re: ui_out format strings for fields and styles (Re: [PATCH] Style "pwd" output)) Pedro Alves
2019-07-01 13:17 ` ui_out format strings for fields and styles (Re: [PATCH] Style "pwd" output) Pedro Alves
2019-07-01 13:20 ` Pedro Alves
2019-07-01 17:38 ` Tom Tromey
2019-07-01 18:49 ` Tom Tromey
2019-07-01 18:56 ` Pedro Alves
2019-07-01 19:30 ` [users/palves/format_strings] Document the gdb-specific formatters Pedro Alves
2019-07-01 19:25 ` [users/palves/format_strings] Introduce string_field Pedro Alves
2019-07-01 17:43 ` ui_out format strings for fields and styles (Re: [PATCH] Style "pwd" output) Tom Tromey
2019-07-01 19:29 ` [users/palves/format_strings] Make printf_filtered support the gdb-specific formatters too Pedro Alves
2019-07-01 12:01 ` ui_out format strings for fields and styles (Re: [PATCH] Style "pwd" output) Pedro Alves
2019-07-01 12:25 ` Tom Tromey
2019-07-01 12:37 ` Pedro Alves
2019-07-01 17:20 ` Tom Tromey
2019-07-01 19:27 ` [users/palves/format_strings] %pS/%pN -> %p[/%p] Pedro Alves
2019-07-01 19:32 ` ui_out format strings for fields and styles (Re: [PATCH] Style "pwd" output) Philippe Waroquiers
2019-07-03 12:20 ` Tom Tromey
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=bfe38994-04d9-23c5-bc88-084db221fc48@redhat.com \
--to=palves@redhat.com \
--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