From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128323 invoked by alias); 28 Oct 2019 17:36:36 -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 128314 invoked by uid 89); 28 Oct 2019 17:36:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=notion, referring, unclear X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 28 Oct 2019 17:36:34 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iP8wS-0006Il-DZ; Mon, 28 Oct 2019 13:36:32 -0400 Received: from [176.228.60.248] (port=4780 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iP8wR-0004gk-Gq; Mon, 28 Oct 2019 13:36:31 -0400 Date: Mon, 28 Oct 2019 17:36:00 -0000 Message-Id: <83wocorcva.fsf@gnu.org> From: Eli Zaretskii To: Marco Barisione CC: gdb-patches@sourceware.org In-reply-to: <20191028133234.319-1-mbarisione@undo.io> (message from Marco Barisione on Mon, 28 Oct 2019 13:32:34 +0000) Subject: Re: [PATCH] Add a way to preserve overridden GDB commands for later invocation References: <20191028133234.319-1-mbarisione@undo.io> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2019-10/txt/msg00993.txt.bz2 > From: Marco Barisione > Date: Mon, 28 Oct 2019 13:32:34 +0000 > > diff --git a/gdb/NEWS b/gdb/NEWS > index 25e67e43c8..e0f1f0a9c1 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -71,6 +71,14 @@ > ** gdb.Block now supports the dictionary syntax for accessing symbols in > this block (e.g. block['local_variable']). > > + ** gdb.Command has a new method 'invoke_overridden' to invoke the > + command with the same name, if any, which was overridden by the new > + command. gdb.Command.__init__ has a new 'preserve_when_overridden' > + argument which, if true (the default is false), means that the > + command, once overridden by another command of the same name, can > + still be invoked through the new command's 'invoke_overridden' > + method. This part is OK. > +@var{preserve_when_overridden} is an optional argument. If @code{True}, > +then the new command is not deleted when it's overridden by another > +command with the same name, otherwise it's deleted. When a command is > +preserved, the overriding command can still invoke it through its > +@code{invoke_overridden} method. When you describe a complex new notion, it is important to use the same words consistently when referring to the same things. In this case, you first used "not deleted", and later referred to the same thing as "preserved". Not every reader will correctly conclude that these two mean the same. So, to avoid confusion, use just one of the two in both instances, okay? > +@defun Command.invoke_overridden (argument, from_tty) > +If the command overrode another command of the same name, ^^^^^^^^ "overrides" is better, I think. > + this can be > +invoked through this method as long as the overridden command supports this > +feature. What did you mean by "this" here? It's unclear. > +@item > +All commands defined by @value{GDBN} itself support being invoked when ^^^^^^^^^^^^ "All the commands" Thanks.