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

abdul.b.ijaz abijaz@ecsmtp.iul.intel.com
Wed Dec 29 11:14:44 GMT 2021


Hi All,

For variable shadowing case this V2 patches add annotation "shadowed" with location information  to the shadowed variables so that it is easier for end user to identify which variable was shadowed and also rebase patches to current master.

V1 of this series can be found at:
https://sourceware.org/pipermail/gdb-patches/2021-July/181174.html

Changes since V1:
* Update shadowed annonation to print location in "info locals" and mi commands "-stack-list-locals/variables" as per Philippe feedback.
* Update tests according to the above change.
* Rebase patches to current master.

@Philippe can you please review if new patch set fulfills the location information for shadowed variables.

@jonah can you please provide your feedback for this change since second patch will change the response of '-stack-list-locals' and '-stack-list-variables' command.

GDB Testsuite is executed on Ubuntu18.04 OS and there is no regression seen with this change. mi2-amd64-entry-value, inline-locals and entry-values tests were affected with this change so they were updated accordingly.

Best Regards,
Abdul Basit

Abdul Basit Ijaz (2):
  gdb: add annotation in 'info locals' command for variables shadowing
    case
  gdb: add shadowed_loc field in '-stack-list-locals/variables' mi
    commands

 gdb/doc/gdb.texinfo                           |  24 +++
 gdb/mi/mi-cmd-stack.c                         |  38 ++++-
 gdb/printcmd.c                                |  15 +-
 gdb/stack.c                                   |  41 +++++-
 gdb/stack.h                                   |   3 +-
 gdb/testsuite/gdb.base/var-shadowing.c        |  52 +++++++
 gdb/testsuite/gdb.base/var-shadowing.exp      |  85 +++++++++++
 gdb/testsuite/gdb.mi/mi-var-shadowing.c       |  48 ++++++
 gdb/testsuite/gdb.mi/mi-var-shadowing.exp     | 138 ++++++++++++++++++
 gdb/testsuite/gdb.mi/mi2-amd64-entry-value.c  |   6 +-
 .../gdb.mi/mi2-amd64-entry-value.exp          |  23 +--
 gdb/testsuite/gdb.opt/inline-locals.c         |   2 +-
 gdb/testsuite/gdb.opt/inline-locals.exp       |   8 +-
 gdb/testsuite/gdb.rust/var_reuse.exp          |  33 +++++
 gdb/testsuite/gdb.rust/var_reuse.rs           |  20 +++
 gdb/testsuite/gdb.trace/entry-values.exp      |   2 +-
 gdb/tracepoint.c                              |   3 +-
 gdb/value.h                                   |   3 +-
 18 files changed, 513 insertions(+), 31 deletions(-)
 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.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.31.1



More information about the Gdb-patches mailing list