From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Cc: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Subject: [PATCH v2 0/4] Introduce the "with" command
Date: Tue, 18 Jun 2019 00:39:00 -0000 [thread overview]
Message-ID: <20190618003902.19805-1-palves@redhat.com> (raw)
( 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
next reply other threads:[~2019-06-18 0:39 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-18 0:39 Pedro Alves [this message]
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 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 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
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=20190618003902.19805-1-palves@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--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