From: Abdul Basit Ijaz <abdul.b.ijaz@intel.com>
To: gdb-patches@sourceware.org
Cc: pedro@palves.net, philippe.waroquiers@skynet.be,
aburgess@redhat.com, christina.schimpe@intel.com,
lsix@lancelotsix.com, eliz@gnu.org, abdul.b.ijaz@intel.com,
guinevere@redhat.com
Subject: [PATCH v13 0/2] add annotation in 'info locals' command for variables shadowing case
Date: Wed, 8 Jul 2026 20:08:03 +0200 [thread overview]
Message-ID: <20260708180805.207722-1-abdul.b.ijaz@intel.com> (raw)
Hi All,
For the variable shadowing case, these patches add the annotation "shadowed"
and location information to the shadowed variables so that it is easier for
the end user to identify which variable was shadowed.
Patch #1 updates "info locals" command
Path #2 is for the mi commands '-stack-list-locals' and '-stack-list-variables'.
Last V12 Series:
https://sourceware.org/pipermail/gdb-patches/2025-December/223219.html
V11 Series:
https://sourceware.org/pipermail/gdb-patches/2025-November/223002.html
V10 Series:
https://sourceware.org/pipermail/gdb-patches/2025-April/217019.html
V9 Series:
https://sourceware.org/pipermail/gdb-patches/2025-March/216590.html
V8 Series:
https://sourceware.org/pipermail/gdb-patches/2024-December/214263.html
Documentation in V7 Series was already approved by Eli:
https://sourceware.org/pipermail/gdb-patches/2024-October/212228.html
https://sourceware.org/pipermail/gdb-patches/2024-October/212229.html
Patch#1 V6 was Reviewed-by Larsen:
https://sourceware.org/pipermail/gdb-patches/2024-January/205923.html
Patch#2 V2 was Tested-by Larsen:
https://sourceware.org/pipermail/gdb-patches/2024-January/205922.html
Changes since V12:
* Rebase the patch and a guard for a file_name nullable passed to styled_string
was required and added now accordingly.
* Update copyright years for new files and some minor fixes from last feedback.
Changes since V11:
* This V11 series fixes the feedback from Eli in documentation and still waiting for the feeback from upstream community regarding use of annotation for the non-shadowed variables also. See:
https://sourceware.org/pipermail/gdb-patches/2025-November/223011.html
https://sourceware.org/pipermail/gdb-patches/2025-November/223012.html
Testing is done for unix/m32/native-gdbserver configurations and no issue is seen.
Thanks & Best Rergards
Abdul Basit
Ijaz, Abdul B (2):
gdb: add annotation in 'info locals' command for variables shadowing
case
gdb: add shadowed field in '-stack-list-locals/variables' mi commands
gdb/NEWS | 8 +
gdb/c-typeprint.c | 3 +-
gdb/doc/gdb.texinfo | 47 ++++++
gdb/language.c | 20 +++
gdb/language.h | 19 +++
gdb/mi/mi-cmd-stack.c | 129 +++++++++++-----
gdb/printcmd.c | 38 ++++-
gdb/stack.c | 115 +++++++++++++-
gdb/stack.h | 14 ++
gdb/testsuite/gdb.ada/var_shadowing.exp | 39 +++++
.../gdb.ada/var_shadowing/var_shadowing.adb | 30 ++++
gdb/testsuite/gdb.base/var-shadowing.c | 51 +++++++
gdb/testsuite/gdb.base/var-shadowing.exp | 92 ++++++++++++
gdb/testsuite/gdb.base/var-shadowing2.c | 16 ++
gdb/testsuite/gdb.mi/mi-var-shadowing.c | 50 +++++++
gdb/testsuite/gdb.mi/mi-var-shadowing.exp | 141 ++++++++++++++++++
gdb/testsuite/gdb.opt/inline-locals.exp | 21 ++-
gdb/testsuite/gdb.rust/var_reuse.exp | 36 +++++
gdb/testsuite/gdb.rust/var_reuse.rs | 20 +++
gdb/value.h | 26 +++-
20 files changed, 857 insertions(+), 58 deletions(-)
create mode 100644 gdb/testsuite/gdb.ada/var_shadowing.exp
create mode 100644 gdb/testsuite/gdb.ada/var_shadowing/var_shadowing.adb
create mode 100755 gdb/testsuite/gdb.base/var-shadowing.c
create mode 100755 gdb/testsuite/gdb.base/var-shadowing.exp
create mode 100644 gdb/testsuite/gdb.base/var-shadowing2.c
create mode 100644 gdb/testsuite/gdb.mi/mi-var-shadowing.c
create mode 100644 gdb/testsuite/gdb.mi/mi-var-shadowing.exp
create mode 100755 gdb/testsuite/gdb.rust/var_reuse.exp
create mode 100755 gdb/testsuite/gdb.rust/var_reuse.rs
--
2.34.1
Intel Deutschland GmbH
Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
next reply other threads:[~2026-07-08 18:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 18:08 Abdul Basit Ijaz [this message]
2026-07-08 18:08 ` [PATCH v13 1/2] gdb: " Abdul Basit Ijaz
2026-07-13 12:49 ` Andrew Burgess
2026-07-13 13:45 ` Ijaz, Abdul B
2026-07-13 15:12 ` Andrew Burgess
2026-07-13 20:06 ` Ijaz, Abdul B
2026-07-08 18:08 ` [PATCH v13 2/2] gdb: add shadowed field in '-stack-list-locals/variables' mi commands Abdul Basit Ijaz
2026-07-13 15:11 ` Andrew Burgess
2026-07-13 20:39 ` Ijaz, Abdul B
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=20260708180805.207722-1-abdul.b.ijaz@intel.com \
--to=abdul.b.ijaz@intel.com \
--cc=aburgess@redhat.com \
--cc=christina.schimpe@intel.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=guinevere@redhat.com \
--cc=lsix@lancelotsix.com \
--cc=pedro@palves.net \
--cc=philippe.waroquiers@skynet.be \
/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