public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Introduce the "with" command
@ 2019-06-18  0:39 Pedro Alves
  2019-06-18  0:39 ` [PATCH v2 3/4] "maint test-settings set/show" -> "maint set/show test-settings" Pedro Alves
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Pedro Alves @ 2019-06-18  0:39 UTC (permalink / raw)
  To: gdb-patches; +Cc: Philippe Waroquiers

( See original discussion and prototype here:
   https://sourceware.org/ml/gdb-patches/2019-05/msg00570.html )

 (gdb) help with
 Temporarily set SETTING to VALUE, run COMMAND, and restore SETTING.
 Usage: with SETTING [VALUE] [-- COMMAND]
 Usage: w SETTING [VALUE] [-- COMMAND]
 With no COMMAND, repeats the last executed command.
 SETTING is any setting settable with the "set" command.
 E.g.:
   with language pascal -- print obj
   with print elements unlimited -- print obj

More details in patch #4.

New in v2:

 - Now a series of 4 patches instead of a single patch.  The main
   patch is patch #4.  This patch includes documentation bits.

 - The "with" command's implementation moved from printcmd.c to
   cli/cli-cmds.c, near "show".

 - Philippe pointed out a bug in v1.  The issue was related to how on
   var_uinteger commands, "unlimited" is user-visible as "0", but
   stored internally in the command's control variable as "-1".
   Without proper internal/user-visible translation, restoring a
   setting's original value failed, if the setting was originally set
   to "unlimited".  In order to fix that, in v2 I'm reusing code from
   do_show_command to convert the set/show command's control variable
   to a string representation.

 - In order to thoroughly test the point above, I thought I'd reuse
   the recently introduced "maint test-settings set/show
   uinteger/zuinteger-unlimited/..." commands, in order to test "with"
   against all command type variants (all enum var_types).  But,
   instead of adding a new "maint test-settings with" command just for
   that, I thought that it was better if we added a more broadly
   usable "maint with" command that worked with all maintenance
   settings.  So the series includes a patch to rename "maint
   test-settings set/show" to "maint set/show test-settings".  That's
   patch #3.  That patch includes documentation bits, though
   of borderline-obvious kind.

- Making the new gdb.base/with.exp testcase exercise "maint with
  test-settings" uncovered bugs in the "maint set/show test-settings"
  settings.  Those are fixed by patch #1.

Pedro Alves (4):
  Fix defaults of some "maint test-settings" subcommands
  Fix a few comments in maint-test-settings.c
  "maint test-settings set/show" -> "maint set/show test-settings"
  Introduce the "with" command

 gdb/doc/gdb.texinfo                 | 101 +++++++++++++-
 gdb/NEWS                            |  18 ++-
 gdb/cli/cli-cmds.c                  | 129 +++++++++++++++++-
 gdb/cli/cli-cmds.h                  |  13 ++
 gdb/cli/cli-setshow.c               |  74 +++++-----
 gdb/cli/cli-setshow.h               |   5 +
 gdb/command.h                       |  19 +--
 gdb/maint-test-settings.c           | 167 +++++++++++------------
 gdb/maint.c                         |  27 ++++
 gdb/testsuite/gdb.base/settings.exp |  35 ++---
 gdb/testsuite/gdb.base/with.c       |  41 ++++++
 gdb/testsuite/gdb.base/with.exp     | 261 ++++++++++++++++++++++++++++++++++++
 gdb/top.c                           |   7 +-
 13 files changed, 738 insertions(+), 159 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/with.c
 create mode 100644 gdb/testsuite/gdb.base/with.exp

-- 
2.14.5

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

end of thread, other threads:[~2020-05-11 14:54 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18  0:39 [PATCH v2 0/4] Introduce the "with" command Pedro Alves
2019-06-18  0:39 ` [PATCH v2 3/4] "maint test-settings set/show" -> "maint set/show test-settings" Pedro Alves
2019-06-18 16:35   ` Eli Zaretskii
2019-06-18  0:39 ` [PATCH v2 2/4] Fix a few comments in maint-test-settings.c Pedro Alves
2019-06-18  0:39 ` [PATCH v2 4/4] Introduce the "with" command Pedro Alves
2019-06-18 16:42   ` Eli Zaretskii
2019-06-19 15:46     ` Pedro Alves
2019-06-19 16:53       ` Eli Zaretskii
2019-06-19 17:20         ` [PATCH v2.1] " Pedro Alves
2019-06-22 10:30           ` Philippe Waroquiers
2019-06-22 11:48             ` Pedro Alves
2019-06-22 12:09               ` Philippe Waroquiers
2019-06-18  0:39 ` [PATCH v2 1/4] Fix defaults of some "maint test-settings" subcommands Pedro Alves
2019-06-19  0:34 ` [PATCH v2 0/4] Introduce the "with" command Philippe Waroquiers
2019-06-19 13:05   ` Pedro Alves
2019-06-19 13:40     ` Philippe Waroquiers
2019-07-03 12:49 ` Pedro Alves
2019-08-02 23:24   ` New FAIL on gdb.base/with.exp on native-extended-gdbserver (was: Re: [PATCH v2 0/4] Introduce the "with" command) Sergio Durigan Junior
2020-05-11 14:54     ` [PATCH] gdb/testsuite: fix gdb.base/with.exp failure with, native-extended-gdbserver (was: New FAIL on gdb.base/with.exp on native-extended-gdbserver) Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).