Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v2 0/1] gdb: add 'set print shadowed' to hide shadowed variables
@ 2026-08-18  8:14 Stephan Rohr
  2026-08-18  8:14 ` [PATCH v2 1/1] gdb: Introduce new setting to filter out " Stephan Rohr
  0 siblings, 1 reply; 5+ messages in thread
From: Stephan Rohr @ 2026-08-18  8:14 UTC (permalink / raw)
  To: gdb-patches; +Cc: simark

From: "Rohr, Stephan" <stephan.rohr@intel.com>

Hello all,

this is version 2 of the patch adding a new print option "set print
shadowed on|off".  You can find v1 of the patch at:

https://sourceware.org/pipermail/gdb-patches/2026-August/229335.html

Simon posted feedback:

https://sourceware.org/pipermail/gdb-patches/2026-August/229420.html

I addressed the feedback from v1 and implemented the following:

  * Added an option '-shadowed on|off' to the 'info locals' command.
  * Rephrased the "use 'set print shadowed on|off' .." message.
  * Fixed the corner case identified by Simon:

      Breakpoint 1, main () at test.c:3
      3           { int x = 2; x = x + 1; /* bp */ return x; }
      (gdb) set print shadowed off
      (gdb) info locals -t double
      No matching locals.
      Some shadowed variables were omitted, use 'set print shadowed on'
      to include them.

  * Avoid printing the "use 'set print shadowed' .." hint for every
    frame in the backtrace command.

I appreciate your feedback.

Thanks
Stephan

Sargsyan, Eduard (1):
  gdb: Introduce new setting to filter out shadowed variables.

 gdb/NEWS                                 |  14 +++
 gdb/doc/gdb.texinfo                      |  22 +++-
 gdb/stack.c                              | 143 +++++++++++++++++++----
 gdb/testsuite/gdb.ada/var_shadowing.exp  |   1 +
 gdb/testsuite/gdb.base/options.exp       |  23 ++++
 gdb/testsuite/gdb.base/var-shadowing.c   |   2 +-
 gdb/testsuite/gdb.base/var-shadowing.exp |  81 +++++++++++++
 7 files changed, 263 insertions(+), 23 deletions(-)

-- 
2.43.0

________________________________________
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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-27 15:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-18  8:14 [PATCH v2 0/1] gdb: add 'set print shadowed' to hide shadowed variables 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
2026-08-27 15:43       ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox