From patchwork Sat May 25 19:58:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Philippe Waroquiers X-Patchwork-Id: 32857 Received: (qmail 118780 invoked by alias); 25 May 2019 19:58:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 118772 invoked by uid 89); 25 May 2019 19:58:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=apropos, HContent-Transfer-Encoding:8bit X-HELO: mailsec117.isp.belgacom.be Received: from mailsec117.isp.belgacom.be (HELO mailsec117.isp.belgacom.be) (195.238.20.113) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 25 May 2019 19:58:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1558814326; x=1590350326; h=message-id:subject:from:to:date:in-reply-to:references: mime-version:content-transfer-encoding; bh=+m3DyVhWOlOKdpfvV7jI+muEKWZS0f23Sygsdkchyv4=; b=B9G+OrkqnflZoKide1YmGsxFt4dPhmRDyBdVatosy277VfzGf4KSKYQb rHlOwKRcH5lM6nGDOg3rK5gctiIDqA==; Received: from 161.32-242-81.adsl-dyn.isp.belgacom.be (HELO md) ([81.242.32.161]) by relay.skynet.be with ESMTP/TLS/AES256-GCM-SHA384; 25 May 2019 21:58:43 +0200 Message-ID: <1558814323.1454.22.camel@skynet.be> Subject: Re: [PATCH 15/24] Introduce rename_cmd From: Philippe Waroquiers To: Pedro Alves , gdb-patches@sourceware.org Date: Sat, 25 May 2019 21:58:43 +0200 In-Reply-To: <20190522205327.2568-16-palves@redhat.com> References: <20190522205327.2568-1-palves@redhat.com> <20190522205327.2568-16-palves@redhat.com> Mime-Version: 1.0 X-IsSubscribed: yes On Wed, 2019-05-22 at 21:53 +0100, Pedro Alves wrote: > diff --git a/gdb/command.h b/gdb/command.h > index 35006cc339e..ed848114b85 100644 > --- a/gdb/command.h > +++ b/gdb/command.h > @@ -439,6 +439,11 @@ extern void > struct cmd_list_element **set_list, > struct cmd_list_element **show_list); > > +/* Move command OLD_NAME from OLD_LIST to NEW_LIST and rename it from > + OLD_NAME to NEW_NAME. */ > +extern void rename_cmd (const char *old_name, cmd_list_element **old_list, > + const char *new_name, cmd_list_element **new_list); > + I have some difficulties to understand the idea here. If the command is moved from one list to another, how is the renamed command still available via the 'normal' list ? Effectively, it looks like set/show print raw-frame-arguments commands are not known. Why not just keep the old command untouched, and define a new command via the new framework. Below is just a patch (based on HEAD) that defines 2 different set/show changing the same variable: (gdb) apropos raw form set print raw frame-arguments -- Set whether to print frame arguments in raw form set print raw-frame-arguments -- Set whether to print frame arguments in raw form show print raw frame-arguments -- Show whether to print frame arguments in raw form show print raw-frame-arguments -- Show whether to print frame arguments in raw form (gdb) set print raw frame-arguments on (gdb) show print raw frame-arguments  Whether to print frame arguments in raw form is on. (gdb) show print raw-frame-arguments  Whether to print frame arguments in raw form is on. (gdb) set print raw-frame-arguments off (gdb) show print raw frame-arguments Whether to print frame arguments in raw form is off. (gdb) show print raw-frame-arguments  Whether to print frame arguments in raw form is off. (gdb)  I guess this should still work if the same variable is changed via the new framework and/or via add_setshow_boolean_cmd. The old commands might be marked as obsolete. Philippe diff --git a/gdb/stack.c b/gdb/stack.c index 408c795e38..05b11e6ecb 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -3106,6 +3106,16 @@ Usage: func NAME"));                         _("Show printing of non-scalar frame arguments"),                         NULL, NULL, NULL, &setprintlist, &showprintlist);   + +  add_setshow_boolean_cmd ("raw-frame-arguments", no_class, +                          &print_raw_frame_arguments, _("\ +Set whether to print frame arguments in raw form."), _("\ +Show whether to print frame arguments in raw form."), _("\ +If set, frame arguments are printed in raw form, bypassing any\n\ +pretty-printers for that value."), +                          NULL, NULL, +                          &setprintlist, &showprintlist); +    add_setshow_boolean_cmd ("frame-arguments", no_class,                            &print_raw_frame_arguments, _("\  Set whether to print frame arguments in raw form."), _("\