[v5,0/2] add annotation in 'info locals' command for variables shadowing case

Message ID 20231121095516.22987-1-abdul.b.ijaz@intel.com
Headers
Series add annotation in 'info locals' command for variables shadowing case |

Message

Abdul Basit Ijaz Nov. 21, 2023, 9:55 a.m. UTC
  From: "Ijaz, Abdul B" <abdul.b.ijaz@intel.com>

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.

V4 series:
https://sourceware.org/pipermail/gdb-patches/2023-September/202637.html

V3 series:
https://sourceware.org/pipermail/gdb-patches/2023-September/202574.html

V2 series:
https://sourceware.org/pipermail/gdb-patches/2021-December/184675.html

Feedback for V2 series:
https://sourceware.org/pipermail/gdb-patches/2022-January/184822.html
https://sourceware.org/pipermail/gdb-patches/2022-January/184819.html

V1 series:
https://sourceware.org/pipermail/gdb-patches/2021-July/181174.html

Patch#1 updates "info locals" command and Path #2 is for the mi commands
'-stack-list-locals' and '-stack-list-variables'.

Changes since V3:
* Rebase the patch series to latest master for verifying failure
  reported by Larsen in newly added RUSTC test.
* Added XFAIL for newly added RUSTC test as it fails on OS having
  RUSTC version >= 1.73 e.g. Fedora 37.  Breakpoints are not hitting
  as expected so could be code is optimizing out but created a GDB bugzilla
(https://sourceware.org/pipermail/gdb-patches/2023-September/202637.html) 
  for the issue.

GDB Testsuite is executed on Ubuntu22 and have not seen any regression
while affected test was executed on Fedora 37 to confirm the XFAIL is
handled properly.

Thanks & Best Regards,
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/doc/gdb.texinfo                           |  26 ++++
 gdb/mi/mi-cmd-stack.c                         |  66 +++++++-
 gdb/printcmd.c                                |  11 +-
 gdb/stack.c                                   |  64 +++++++-
 gdb/stack.h                                   |   3 +-
 gdb/testsuite/gdb.ada/var_shadowing.exp       |  38 +++++
 .../gdb.ada/var_shadowing/var_shadowing.adb   |  30 ++++
 gdb/testsuite/gdb.base/var-shadowing.c        |  49 ++++++
 gdb/testsuite/gdb.base/var-shadowing.exp      |  90 +++++++++++
 gdb/testsuite/gdb.base/var-shadowing2.c       |  16 ++
 gdb/testsuite/gdb.mi/mi-var-shadowing.c       |  48 ++++++
 gdb/testsuite/gdb.mi/mi-var-shadowing.exp     | 141 ++++++++++++++++++
 gdb/testsuite/gdb.rust/var_reuse.exp          |  34 +++++
 gdb/testsuite/gdb.rust/var_reuse.rs           |  20 +++
 gdb/tracepoint.c                              |   3 +-
 gdb/value.h                                   |   4 +-
 16 files changed, 628 insertions(+), 15 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