From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 0D7683844008 for ; Mon, 19 Oct 2020 19:28:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0D7683844008 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=undo.io Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mbarisione@undo.io Received: by mail-wr1-x430.google.com with SMTP id h5so987048wrv.7 for ; Mon, 19 Oct 2020 12:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=undo-io.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=BTfzcltRBekIy1IKWZDvGdG0NMBYjKWZuLQAixmXX2I=; b=t84zTvO6uSpbUkOSmzZ1KHL7qMx6l1O/6djFiXomcc2JM/Qr26Pm+fOVz8sVLriDUZ uTsyW0ZYpXmzsh5ZiVBsf0R841kbxnNlpGf6+V1CfwFNfdJ8aKa6bd6AgyIiFCov9Lfo BQuFVw2BhZD6uOHOyZpPc4I4aVSHYp1U7q38G+aC8sfxkHN6n0EjAmvaO8Q5MiSVDR6S 64XcopT8R3KHC2LafEeFn7GrcXT36O+aX89EfNBcg1042CkAjrhg+tq7lnP9mY0etrdW LL9SmdEkpD8Pbe3xhKDJz4MRl+3YhwVz+3wQE/fxgyXN/V2MTuGDD4/GdBOgovf1riIm pW9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=BTfzcltRBekIy1IKWZDvGdG0NMBYjKWZuLQAixmXX2I=; b=Mj8L9b3hAXogZfy4Merm5559AheSZcXqAioMGes7uNdbi/hANlGGedc1yIr/U1lngG IEXlBTtxi/zdu4oOFKpDNf4QCALZITwllcV3TIp6hfjZLkpnBREm3/gd6VAsNJliaLVG SQhDdq+22X5eMhtJBqo383AQ2iYG9bDStYw+PBPiDVzepEcQ+TRiImM7DejGfUvSFUfN VL3ulvzsbWlWAT7h8QplgfYbvN2S7wHbNuXs62OQ7rkWqwzEk1CMjA+DPfBqFgtsLP4V D2pzGol7WpMvcG28HtCS5ymOQa54bJKB43jPg51gWzzuYBEQVunpAW/Rqg7PXgFIbQWL /cIg== X-Gm-Message-State: AOAM533md10hLCpJ3MYvEMus5YX2sY5Mx/cPBeUqLsiKjeJLC46s3ksY ZK9wCTE1lUomd7QB1fhCULFAKw== X-Google-Smtp-Source: ABdhPJytP7koiH4FHQg61ZIJ/2eSST1fxUVEigWO4a5BpGmUWf2N11CYeLFqJlfWK6G7LH2YvMvl3g== X-Received: by 2002:adf:f1c1:: with SMTP id z1mr810955wro.331.1603135732037; Mon, 19 Oct 2020 12:28:52 -0700 (PDT) Received: from [192.168.0.114] (cpc159317-cmbg20-2-0-cust117.5-4.cable.virginm.net. [81.111.29.118]) by smtp.gmail.com with ESMTPSA id n4sm829366wrr.91.2020.10.19.12.28.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Oct 2020 12:28:50 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.0.3.2.82\)) Subject: Re: Add a way to invoke redefined (overridden) GDB commands From: Marco Barisione In-Reply-To: <553d9751c944c660dad4a204cf4609c660baa106.camel@skynet.be> Date: Mon, 19 Oct 2020 20:28:49 +0100 Cc: Pedro Alves , gdb-patches@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: <167570B7-6E55-4136-97DB-2D0F2B191B7D@undo.io> References: <20200914093925.5442-1-mbarisione@undo.io> <371BE292-EE03-4FBE-A963-64F08437A6A7@undo.io> <553d9751c944c660dad4a204cf4609c660baa106.camel@skynet.be> To: Philippe Waroquiers X-Mailer: Apple Mail (2.3654.0.3.2.82) X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Mon, 19 Oct 2020 19:28:55 -0000 On 19 Oct 2020, at 19:47, Philippe Waroquiers = wrote: > On Mon, 2020-10-19 at 19:05 +0100, Pedro Alves wrote: >> ISTM that (optional) quotes would be the natural thing here: >>=20 >> (gdb) rename "foo bar" "baz" >> (gdb) rename "foo" "bar baz" >>=20 >> I'd rather leave "--" for the typical splitting of options from >> other arguments. Commands get that for free if they use >> the cli/cli-option.h framework. So "--" would be used like in other >> commands, to unambiguously split options from commands that may >> start with "-", like: > Effectively better to keep -- to separate options from args. >=20 > For what concerns the rename, alias uses =3D to separate > the 2 commands: > (gdb) h alias > Define a new command that is an alias of an existing command. > Usage: alias [-a] [--] ALIAS =3D COMMAND [DEFAULT-ARGS...] > ... > So, maybe better/more consistent to use =3D similarly for rename. >=20 > 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=E2=80=99s a very good point. I didn=E2=80=99t 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=E2=80=99t think of any way of making a rename command work like = this. Any idea? Otherwise, would my original patch be acceptable if I changed the name from up level and only use relative levels? --=20 Marco Barisione