From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39966 invoked by alias); 6 Nov 2019 16:00:45 -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 39690 invoked by uid 89); 6 Nov 2019 16:00:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (205.139.110.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 06 Nov 2019 16:00:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573056012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9L4qA07kZq+gkAubWdlZJI35W56zfbhEEATJGu/l2sE=; b=acxz78p76W0Ktr2MsqhsTEnky0XyjnkiHO+8bGP1X5zmqAgLNCQIT7ijcMtMjZUjGaGZCF h08on/dXjDo3TWsa6Buoq+ccuf5lMJUyOfrfBuh6tZJsy8xeP+B4xvW7WF9L50mI/N4uW7 LSQ7AuViuwFZ++htCHmBG9LXgzKUV0M= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-424-OshbCQZ6PpaoGEoW2MhJmQ-1; Wed, 06 Nov 2019 11:00:11 -0500 Received: by mail-wr1-f72.google.com with SMTP id g17so9735734wru.4 for ; Wed, 06 Nov 2019 08:00:10 -0800 (PST) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:56ee:75ff:fe8d:232b? ([2001:8a0:f913:f700:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id b17sm3301620wrr.37.2019.11.06.08.00.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Nov 2019 08:00:08 -0800 (PST) Subject: Re: [PATCH v2] Add a way to preserve overridden GDB commands for later invocation To: Andrew Burgess , Marco Barisione References: <20191028133234.319-1-mbarisione@undo.io> <20191101085449.28493-1-mbarisione@undo.io> <87wocj1k3y.fsf@tromey.com> <2E9BBFD2-6643-4958-AF6B-FFC974FFF479@undo.io> <20191105101745.GC11037@embecosm.com> Cc: Tom Tromey , gdb-patches@sourceware.org From: Pedro Alves Message-ID: <88223a28-9edf-d7bb-92ed-2fdeaea0c491@redhat.com> Date: Wed, 06 Nov 2019 16:00:00 -0000 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: <20191105101745.GC11037@embecosm.com> X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2019-11/txt/msg00166.txt.bz2 On 11/5/19 10:17 AM, Andrew Burgess wrote: > in order to get the base version of the command. Second, with some > extra work we could make the existing hook mechanism redundant, and > possibly provide something more flexible (maybe?), consider: >=20 > define delete > echo Basically a pre-hook here\n > uplevel -1 delete $argv > echo Basically a post-hook here\n > end >=20 > Notice I just invented '$argv' on the fly there - this doesn't exist > currently, but I'm imagining that this would expand to all of the > arguments passed to the newly defined 'delete' command. Something like "$@" would be better than $argv, because the latter implies that arguments are split into an "argument vector", which doesn't work correctly in general because different commands split arguments in different forms. Thanks, Pedro Alves