Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Stephan Rohr <stephan.rohr@intel.com>
Cc: gdb-patches@sourceware.org,  simark@simark.ca
Subject: Re: [PATCH v2 1/1] gdb: Introduce new setting to filter out shadowed variables.
Date: Fri, 21 Aug 2026 13:03:08 -0600	[thread overview]
Message-ID: <877bljpa8j.fsf@tromey.com> (raw)
In-Reply-To: <20260818081452.17464-2-stephan.rohr@intel.com> (Stephan Rohr's message of "Tue, 18 Aug 2026 08:14:52 +0000")

>>>>> "Stephan" == Stephan Rohr <stephan.rohr@intel.com> writes:

Stephan> +* New commands
Stephan> +
Stephan> +set print shadowed on|off
Stephan> +show print shadowed
Stephan> +This controls the output of the "info locals" command.  If the option is 'off'
Stephan> +shadowed variables will be omitted in output.  The default is to print
Stephan> +shadowed variables.

Needs a doc review but I think the explanation lines should be indented.

Stephan> +/* Option for printing shadowed variables.  */
Stephan> +
Stephan> +struct shadowed_print_options
Stephan> +{
Stephan> +  bool print_shadowed = true;

I don't really follow why this type is needed.

Stephan>    print_variable_and_value (print_name, sym, frame, stream, num_tabs,
Stephan> -			    shadow_status);
Stephan> +			    print_shadowed ? shadow_status
Stephan> +					   : var_shadowing::NONE);

Lining things up like this isn't really the gdb style; you could break
before the "?" instead.

Stephan> +  if (cb_data.printed_shadowed_variables)
Stephan> +    gdb_printf (stream,
Stephan> +		_("Use 'set print shadowed off' "
Stephan> +		  "to hide shadowed variables.\n"));
Stephan> +  else if (cb_data.omitted_shadowed_variables)
Stephan> +    gdb_printf (stream,
Stephan> +		_("Some shadowed variables were omitted, use "
Stephan> +		  "'set print shadowed on' to include them.\n"));

I'm slowly trying to transition gdb to using double quotes rather than
the current mishmash of quoting styles.

Also command names should be styled using command_style.

thanks,
Tom

  reply	other threads:[~2026-08-21 19:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18  8:14 [PATCH v2 0/1] gdb: add 'set print shadowed' to hide " Stephan Rohr
2026-08-18  8:14 ` [PATCH v2 1/1] gdb: Introduce new setting to filter out " Stephan Rohr
2026-08-21 19:03   ` Tom Tromey [this message]
2026-08-24 15:05     ` Rohr, Stephan
2026-08-27 15:43       ` 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=877bljpa8j.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    --cc=stephan.rohr@intel.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