From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Vt1GHu38jl+WbwAAWB0awg (envelope-from ) for ; Tue, 20 Oct 2020 11:06:21 -0400 Received: by simark.ca (Postfix, from userid 112) id 74E371EFC1; Tue, 20 Oct 2020 11:06:21 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 5530C1E58E for ; Tue, 20 Oct 2020 11:06:20 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BDB1D3945065; Tue, 20 Oct 2020 15:06:19 +0000 (GMT) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by sourceware.org (Postfix) with ESMTPS id 36AAB3851C25 for ; Tue, 20 Oct 2020 15:06:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 36AAB3851C25 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wr1-f43.google.com with SMTP id n18so2577466wrs.5 for ; Tue, 20 Oct 2020 08:06:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=c2pIVc57XBtmArgZDTs7C2Gywf+pcmJT9mgXS5C+/5U=; b=Tfc7gntte8hci5QrhCC8Q8uepNthYcYdf0FsnlohDpTobzsaV4closKWKa/V9TNZqX 9sjLoKnX6FwysqlONLEAT7UU4wKOu1Esd3N6p1+BudjXLUg8mMLR8oRL0IPXk/fh+5ye apHI4wNQ9H7m7yn3B7L4N+t2RcLwr/FQWj8oH3rCLbtYV8vwiADYq4aQVdaFHMeOorBF AlCx1B+DZvhvORqbAFVQVKAfKalVcCQp3xkIDJOATmoczn1H2E3XmXFYA6oG9yeexcpG 21ycVc1aI09MRlcCitKXPxM19JDgr0gfIm4iazMwij8Rd58/LqFhr5ouz9NTQxG0nYVW /U2A== X-Gm-Message-State: AOAM533NVJj3dovy7zDoHEN6m51KDJKabSV3QiC84Ljk8ybjrymVGcx6 wCBaTlFK6fxpNWYSdVchbhhYyWXa79EAUg== X-Google-Smtp-Source: ABdhPJzLuwBH94S64JVoSj1pGZMRfG2CQHWbE4jcwMDTCsUT3k8yPlqa7PKIvIE9nwr4KAJHgJOHyw== X-Received: by 2002:a5d:40c3:: with SMTP id b3mr4420688wrq.157.1603206375415; Tue, 20 Oct 2020 08:06:15 -0700 (PDT) Received: from ?IPv6:2001:8a0:f91e:6d00:c80a:ea25:47ef:5f73? ([2001:8a0:f91e:6d00:c80a:ea25:47ef:5f73]) by smtp.gmail.com with ESMTPSA id a17sm3862779wra.29.2020.10.20.08.06.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Oct 2020 08:06:14 -0700 (PDT) Subject: Re: Add a way to invoke redefined (overridden) GDB commands To: Marco Barisione , Philippe Waroquiers References: <20200914093925.5442-1-mbarisione@undo.io> <371BE292-EE03-4FBE-A963-64F08437A6A7@undo.io> <553d9751c944c660dad4a204cf4609c660baa106.camel@skynet.be> <167570B7-6E55-4136-97DB-2D0F2B191B7D@undo.io> From: Pedro Alves Message-ID: Date: Tue, 20 Oct 2020 16:06:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <167570B7-6E55-4136-97DB-2D0F2B191B7D@undo.io> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit 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: , Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 10/19/20 8:28 PM, Marco Barisione wrote: > On 19 Oct 2020, at 19:47, Philippe Waroquiers wrote: >> I am wondering how rename will interact with alias: >> alias are resolved at definition time, so a rename >> following an alias might not have the expected effect. > > That’s a very good point. I didn’t consider aliases and hooks. > > My use case is for building on top of existing commands so they can > be extended/tweaked. Aliases and hooks need to follow the new > command, including the ones set by users (so I have no way of knowing > about them). > I can’t think of any way of making a rename command work like this. > > Any idea? In my previous example, where it read: (gdb) rename run org_run (gdb) define run ... merge those two commands into a single atomic operation? Like: (gdb) rename-define run org_run > echo Will run!\n > org_run > end (gdb) run Will run! [... normal output of run ...] (gdb) org_run [... normal output of run ...] Unlike "rename", "rename-define" (strawman name) would take care of moving the alias and pre/post hooks to the new implementation. WDYT?