From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40323 invoked by alias); 18 Jun 2019 00:39:10 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 40219 invoked by uid 89); 18 Jun 2019 00:39:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=broadly, maint.c, cli-cmds.h, UD:command.h X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Jun 2019 00:39:07 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ECB3C3082E1E; Tue, 18 Jun 2019 00:39:03 +0000 (UTC) Received: from localhost.localdomain (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2BD4E5E7C6; Tue, 18 Jun 2019 00:39:02 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Cc: Philippe Waroquiers Subject: [PATCH v2 0/4] Introduce the "with" command Date: Tue, 18 Jun 2019 00:39:00 -0000 Message-Id: <20190618003902.19805-1-palves@redhat.com> X-SW-Source: 2019-06/txt/msg00320.txt.bz2 ( 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