From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20760 invoked by alias); 1 Nov 2019 19:18:13 -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 20752 invoked by uid 89); 1 Nov 2019 19:18:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=difficulty, anticipate, HX-Languages-Length:1399 X-HELO: gateway36.websitewelcome.com Received: from gateway36.websitewelcome.com (HELO gateway36.websitewelcome.com) (192.185.187.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 Nov 2019 19:18:11 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 3B1B1400CF463 for ; Fri, 1 Nov 2019 13:26:26 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id QcR0iAOTCOdBHQcR0iSAh8; Fri, 01 Nov 2019 14:18:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=HIS9ZdnyM/sp2CEjTCw/deZFUd7kL0awODfusLHipgI=; b=PRmDJUIa+2+jra/euF4W/ISCVd EwaMYV5jL2U2mTbgbkH2dHpIoDMksbrOMsu3CcUODEpzHPoS4sxei+7Sr5QYWaPaVN7e6z4lIaNMg +w1cRlEWQm+pg98LKllVpbmA9; Received: from 75-166-66-104.hlrn.qwest.net ([75.166.66.104]:59094 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iQcR0-000WZd-1v; Fri, 01 Nov 2019 13:18:10 -0600 From: Tom Tromey To: Marco Barisione Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2] Add a way to preserve overridden GDB commands for later invocation References: <20191028133234.319-1-mbarisione@undo.io> <20191101085449.28493-1-mbarisione@undo.io> Date: Fri, 01 Nov 2019 19:18:00 -0000 In-Reply-To: <20191101085449.28493-1-mbarisione@undo.io> (Marco Barisione's message of "Fri, 1 Nov 2019 08:54:49 +0000") Message-ID: <87wocj1k3y.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-11/txt/msg00041.txt.bz2 >>>>> "Marco" == Marco Barisione writes: Thanks for the patch. I think it's a good idea -- in fact, I've wanted it myself before :-) Do you have a copyright assignment on file? Marco> To avoid unexpected behavioural changes, new commands implemented in Marco> Python are, by default, freed when overridden. A command which wants Marco> the new behaviour can pass the new preserve_when_overridden argument to Marco> gdb.Command.__init__ (). Could you say what unexpected behavioural changes you would anticipate? I tend to think it would be clearer if all commands were treated identically. Is there some implementation difficulty doing it? Or was it just that you didn't think it was useful? In this model, if a Python command overrides a built-in command, and then is itself overridden, can the new command still access the underlying built-in command? What happens in the weird case that you have a command alias X, then override X, and then override the thing that the original X was aliased to? Will calling the overridden X do the right thing? Really I'm wondering if that crashes -- maybe a counter-argument to my wish for generality is that aliases should not be overridden. I skimmed the patch and it seemed ok but I figured we'd want to address these things first. thanks, Tom