From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lndn.lancelotsix.com (vps-42846194.vps.ovh.net [IPv6:2001:41d0:801:2000::2400]) by sourceware.org (Postfix) with ESMTPS id 028213858D3C for ; Sun, 6 Feb 2022 17:14:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 028213858D3C Received: from Plymouth (unknown [IPv6:2a02:390:9086:0:7df6:51f9:bb25:44c1]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 8569880D5D; Sun, 6 Feb 2022 17:13:58 +0000 (UTC) Date: Sun, 6 Feb 2022 17:13:55 +0000 From: Lancelot SIX To: Jan Vrany Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 3/5] gdb/python: allow redefinition of python GDB/MI commands Message-ID: <20220206171355.ldrvzh5pq46hpnom@Plymouth> References: <20220117124425.2658516-1-jan.vrany@labware.com> <20220117124425.2658516-4-jan.vrany@labware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220117124425.2658516-4-jan.vrany@labware.com> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Sun, 06 Feb 2022 17:13:58 +0000 (UTC) X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Feb 2022 17:14:02 -0000 Hi, > @@ -163,6 +164,9 @@ struct mi_command > wrong. */ > void invoke (struct mi_parse *parse) const; > > + /* Return TRUE if the command can be redefined, FALSE otherwise. */ > + virtual bool can_be_redefined (); It looks like that this method can be made const I think. I also did ont pay too close attention in the previous patch, but it looks like you use space indentation. I think GNU standard[1] and GDB codebase uses tab indentation (tab size of 8): The rest of this section gives our recommendations for other aspects of C formatting style, which is also the default style of the indent program in version 1.2 and newer. It corresponds to the options -nbad -bap -nbc -bbo -bl -bli2 -bls -ncdb -nce -cp1 -cs -di2 -ndj -nfc1 -nfca -hnl -i2 -ip5 -lp -pcs -psl -nsc -nsob This way to tell things is not super informative in itself. Depending on the text editor you use, there might be a configuration option to help you automate this. I will not point it out in every place in the patch, but there are multiple instances where your changes lead to a indentation change (i.e. replace 1 tab with 8 spaces). This should be avoided. > --- a/gdb/python/py-micmd.c > +++ b/gdb/python/py-micmd.c > @@ -1,6 +1,6 @@ > /* MI Command Set for GDB, the GNU debugger. > > - Copyright (C) 2019 Free Software Foundation, Inc. > + Copyright (C) 2019-2021 Free Software Foundation, Inc. 2021 will most probably need to become 2022 (and same goes for other new files as well). > class mi_command_py : public mi_command > { > - public: > - /* Constructs a new mi_command_py object. NAME is command name without > - leading dash. OBJECT is a reference to a Python object implementing > - the command. This object should inherit from gdb.MICommand and should > - implement method invoke (args). */ > - mi_command_py (const char *name, gdbpy_ref<> object); > +public: > + /* Constructs a new mi_command_py object. NAME is command name without > + leading dash. OBJECT is a reference to a Python object implementing > + the command. This object should inherit from gdb.MICommand and should > + implement method invoke (args). */ > + mi_command_py (const char *name, gdbpy_ref<> object); Here you change the indentation from the previous patch. This change should probably be moved to it. I understand that this is tedious to change and am sorry for that. Best, Lancelot. [1] https://www.gnu.org/prep/standards/html_node/Formatting.html