From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id pGv2FewBAGI8DwAAWB0awg (envelope-from ) for ; Sun, 06 Feb 2022 12:14:20 -0500 Received: by simark.ca (Postfix, from userid 112) id 48D9F1F3C6; Sun, 6 Feb 2022 12:14:20 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B23ED1EA69 for ; Sun, 6 Feb 2022 12:14:19 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CF79C3858425 for ; Sun, 6 Feb 2022 17:14:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF79C3858425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644167658; bh=JGdDBA1nRbfHtuMU5zgZxFK67ab0HAvXhroE6OOf5Ls=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Qhb/apvlOF1ZN+v1TzAAR32C/qAFPF8KnFjeeWGmQOklElg3t0BZU+AeJDjl9XduF dYThrvnLjUgsDK2vtLWwt7q1HNHJBETCveb0ELR+WFyQ5frrp6Tyf1h/bZUDlSFFvx 8t59Dqb0riI2b0lqz+ctiDqt+p3vPm4QUwG16SMA= 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 To: Jan Vrany 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-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: , From: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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