Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Rohr, Stephan" <stephan.rohr@intel.com>
To: Tom Tromey <tom@tromey.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	"simark@simark.ca" <simark@simark.ca>
Subject: RE: [PATCH v2 1/1] gdb: Introduce new setting to filter out shadowed variables.
Date: Mon, 24 Aug 2026 15:05:50 +0000	[thread overview]
Message-ID: <DS7PR11MB6247A25221CDA41DE1D1EFFD93A02@DS7PR11MB6247.namprd11.prod.outlook.com> (raw)
In-Reply-To: <877bljpa8j.fsf@tromey.com>

Hi Tom,

thanks for the feedback.  I will follow up with a v3 of the patch.  I have one
question regarding your feedback, please see inline below.

Thanks
Stephan

> -----Original Message-----
> From: Tom Tromey <tom@tromey.com>
> Sent: Friday, 21 August 2026 21:03
> To: Rohr, Stephan <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.
> 
> >>>>> "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.

Do you mean why we need the flag or why it is encapsulated into a new
"shadowed_print_options" type? Or why it is not included in any other
print related options struct?

I removed the "-shadowed" option from the "value_print_options" to
avoid the unnecessary "print -shadowed" option in v2.  The "shadowed"
option is used to store the user's setting for the session and can be overwritten
by the "info locals" command.  Thus, I added a new type here similar to
"maintenance_selftest_options" in maint.c.

I separated this from the "info_print_options" as these are per invocation and I
need to store the "print_shadowed" option for the lifetime of the session.  Also,
the "-shadowed" option is only used by the "info locals" command.

> 
> 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
________________________________________
Intel Deutschland GmbH 

Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany 

Tel: +49 (89) 99143-0 

www.intel.de 

Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramachandran Sitaraman

Chairperson of the Supervisory Board: Sonja Pierer

Registered Seat: Munich Commercial Register B: Amtsgericht Munich HRB 186928

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

  reply	other threads:[~2026-08-24 15:06 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
2026-08-24 15:05     ` Rohr, Stephan [this message]
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=DS7PR11MB6247A25221CDA41DE1D1EFFD93A02@DS7PR11MB6247.namprd11.prod.outlook.com \
    --to=stephan.rohr@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    --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