From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125001 invoked by alias); 30 May 2019 10:22:45 -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 124993 invoked by uid 89); 30 May 2019 10:22:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.8 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=Preferences X-HELO: mailsec103.isp.belgacom.be Received: from mailsec103.isp.belgacom.be (HELO mailsec103.isp.belgacom.be) (195.238.20.99) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 30 May 2019 10:22:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1559211762; x=1590747762; h=message-id:subject:from:to:date:in-reply-to:references: mime-version:content-transfer-encoding; bh=IYe6vBf5iRRABc0YxO5uxlAMG8spAJq2qEaifYDyPOI=; b=dPLporzziRzXU50E29bXxPOP+InxuRISHVNbDGTnovtG3Axn+ucsDh20 p/YbbgLUqJG0bCSz+rPNLOfETNszBg==; 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; 30 May 2019 12:22:40 +0200 Message-ID: <1559211760.1454.35.camel@skynet.be> Subject: Re: [PATCH 15/24] Introduce rename_cmd From: Philippe Waroquiers To: Pedro Alves , gdb-patches@sourceware.org Date: Thu, 30 May 2019 10:22:00 -0000 In-Reply-To: References: <20190522205327.2568-1-palves@redhat.com> <20190522205327.2568-16-palves@redhat.com> <1558814323.1454.22.camel@skynet.be> <3db59d5f-481b-64d0-5684-060b9585c3ac@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg00679.txt.bz2 On Wed, 2019-05-29 at 19:30 +0100, Pedro Alves wrote: > On 5/29/19 5:03 PM, Pedro Alves wrote: > > > There are other ways to implement this. I could move the > > "raw-frame-arguments" option_def out of the frame_print_option_defs > > array, so that it doesn't get installed as a command, and leave the > > "set print raw frame-arguments" add_setshow... call in place. > > I guess it wouldn't be a big deal. > > So turns out the change would be pretty simple. > > I'm undecided which version to use... I suppose this version > is simpler and a little bit more efficient. Preferences? As 'frame-arguments' is the only command that uses the prefix 'set print raw' and that this prefix should not be used for further options, I would mark 'set print raw' obsolete, to avoid an inconsistency (at user level) only for this option. But not a big deal ... > > From fcbbc6a33276a8ec59425174f6868379d0a239a3 Mon Sep 17 00:00:00 2001 > From: Pedro Alves > Date: Wed, 29 May 2019 19:04:05 +0100 > Subject: [PATCH] no-rename > > --- > gdb/stack.c | 44 ++++++++++++++++++++++++-------------------- > 1 file changed, 24 insertions(+), 20 deletions(-) > > diff --git a/gdb/stack.c b/gdb/stack.c > index 3054c797c74..2c58b0d728b 100644 > --- a/gdb/stack.c > +++ b/gdb/stack.c > @@ -126,16 +126,16 @@ or both. Note that one or both of these values may be ."), > N_("Show printing of non-scalar frame arguments"), > NULL /* help_doc */ > }, > +}; > > - boolean_option_def { > - "raw-frame-arguments", > - [] (frame_print_options *opt) { return &opt->print_raw_frame_arguments; }, > - NULL, /* show_cmd_cb */ > - N_("Set whether to print frame arguments in raw form."), > - N_("Show whether to print frame arguments in raw form."), > - N_("If set, frame arguments are printed in raw form, bypassing any\n\ > -pretty-printers for that value.") > - }, > +/* The "raw-frame-arguments" option. Defined separately because the > + corresponding "set" command is called "set print raw > + frame-arguments", with space instead of dash. */ > +static const boolean_option_def raw_frame_arguments_option_def { > + "raw-frame-arguments", > + [] (frame_print_options *opt) { return &opt->print_raw_frame_arguments; }, > + NULL, /* show_cmd_cb */ > + N_("Set whether to print frame arguments in raw form."), > }; > > /* Options for the "backtrace" command. */ > @@ -2015,13 +2015,14 @@ backtrace_command_1 (const frame_print_options &fp_opts, > /* Create an option_def_group array grouping all the "backtrace" > options, with FP_OPTS, BT_CMD_OPT, SET_BT_OPTS as contexts. */ > > -static inline std::array > +static inline std::array > make_backtrace_options_def_group (frame_print_options *fp_opts, > backtrace_cmd_options *bt_cmd_opts, > set_backtrace_options *set_bt_opts) > { > return {{ > { {frame_print_option_defs}, fp_opts }, > + { raw_frame_arguments_option_def.def (), fp_opts }, > { {set_backtrace_option_defs}, set_bt_opts }, > { {backtrace_command_option_defs}, bt_cmd_opts } > }}; > @@ -3288,14 +3289,17 @@ source line."), > (class_stack, &user_frame_print_options, > frame_print_option_defs, &setprintlist, &showprintlist); > > - /* The above installs a "set print raw-frame-arguments" command, > - because there's an option called "print -raw-frame-arguments". > - Rename the command to "set print raw frame-arguments" (space > - instead of dash), to keep backward compatibility -- the "raw > - frame-arguments" command already existed when print options were > - first added. */ > - rename_cmd ("raw-frame-arguments", &setprintlist, > - "frame-arguments", &setprintrawlist); > - rename_cmd ("raw-frame-arguments", &showprintlist, > - "frame-arguments", &showprintrawlist); > + /* This one is not defined by the add_setshow_cmds_for_options call > + above, because the option is called "raw-frame-arguments", while > + the command is called "set print raw frame-arguments", with space > + instead of dash. */ > + add_setshow_boolean_cmd ("frame-arguments", no_class, > + &user_frame_print_options.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, > + &setprintrawlist, &showprintrawlist); > }