Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] gdb: don't print escape characters when a style is disabled
Date: Thu, 21 Jan 2021 12:06:18 +0000	[thread overview]
Message-ID: <20210121120618.GX265215@embecosm.com> (raw)
In-Reply-To: <87k0s75rn0.fsf@tromey.com>

* Tom Tromey <tom@tromey.com> [2021-01-20 12:34:43 -0700]:

> >>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:
> 
> Andrew> +# A replacement for the 'style' function found in gdb-utils.exp,
> Andrew> +# filter out requests for the disabled style.
> Andrew> +proc limited_style { str style } {
> 
> Rather than rename the global 'style', I think it would be fine to just
> have a wrapper proc that is used locally.  That seems a lot less tricky.
> Same with clean_restart.
> 
> Andrew>        /* Output pmatch with the highlight style.  */
> Andrew> -      set_output_style (stream, highlight_style.style ());
> Andrew> +      if (!highlight_style.style ().is_default ())
> Andrew> +	set_output_style (stream, highlight_style.style ());
> 
> set_output_style ends up setting applied_style.
> So avoiding this call seems iffy to me.

Tom,

Thanks for the feedback.

It's not clear to me if your feedback is about this one particular use
of the 'if (!STYLE.is_default ()) { ... }' pattern, or if you are
suggesting all uses of this pattern are suspect.

It's just that you added the original uses of this pattern...

So I guess my question would be, if its this one particular case then
I don't understand why this cases is different to all the others,
or...

... if it's all uses of this pattern then I guess my questions is,
does this mean you think the original uses were a mistake?  Or has
something else changed ?

> Maybe another approach would be to change emit_style_escape so that it
> does nothing if the currently-applied style is equal to the passed-in
> style?

I'll give this a try and see if I can get this working.

Thanks,
Andrew

  reply	other threads:[~2021-01-21 12:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14  9:56 [PATCH 0/2] Style related fixes Andrew Burgess
2021-01-14  9:56 ` [PATCH 1/2] gdb: don't print escape characters when a style is disabled Andrew Burgess
2021-01-20 19:34   ` Tom Tromey
2021-01-21 12:06     ` Andrew Burgess [this message]
2021-01-21 16:08       ` Andrew Burgess
2021-01-22 15:26         ` Tom Tromey
2021-01-22 15:21       ` Tom Tromey
2021-01-14  9:56 ` [PATCH 2/2] gdb: add new version style Andrew Burgess
2021-01-14 10:35   ` Andrew Burgess
2021-01-14 11:15   ` Lancelot SIX via Gdb-patches
2021-01-20 19:39     ` Tom Tromey
2021-01-14 14:08   ` Eli Zaretskii via Gdb-patches
2021-01-20 19:39   ` 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=20210121120618.GX265215@embecosm.com \
    --to=andrew.burgess@embecosm.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