From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id C0F9A3857C59 for ; Mon, 28 Sep 2020 07:54:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C0F9A3857C59 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-x42f.google.com with SMTP id j2so92849wrx.7 for ; Mon, 28 Sep 2020 00:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=undo-io.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=TUQtibotQ8XUECgT5QKc5ry4xDOC7h8UO20rikv8dfU=; b=nkGvRQOXXfsU/CZPoavqPKKSJfLhn9mjcVx//5FPdN9BMd/DtLUnR4emGIX8Sa2tHn bVVO401gWfN3LNawUEbDCxBkCFNGc21+S+wnWKv/+ZWWWZ7HZ2O8ipBo/CLywc65+6js CAs+Ok+U9I2k/oUtgS4vucEx2nJWVrbK09/SonNwpyobNbphCdBDLp/e42vaUmOQX0Sr mjDFiwAb0tGk/35jl0eDncjXwkBavwwne9rWNqRRS2GQqy0M/NZ4G3TV3uw886lAOfQ4 Ec7bLj/wQA1rtaqnWmWzyjnMSV02xhsQYvyrt461YivfYFK/0pAzQj83nda/6E/ehVlM 0yTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=TUQtibotQ8XUECgT5QKc5ry4xDOC7h8UO20rikv8dfU=; b=UE2D2pAiVjfblzFFGuYulwwPS6FzNrVIopUkwCUWMUum+Om56AnzgAimNBeDMSNt4f tqv6/xaXfUo0Zb4OImuX5/6FL3OkjBonWGc/xGF9EXvvfQ4WofPEzw8I186qKZgCbEa4 4hxBXIHz3jLNCTwFozD4nLfxoa87VcN2HFwMHKbjaeg5qKKEgt3ad/FyIrLvOkGTj+Yi fBMVebdvWogKN+vdZy968qUCbCfjPrEs+9I/JYxN49XGGZBaQew7xqvjxZJPMyZr0Ggx LT1M/rpTlSTVCm5gBE4lLnmMOTQChmPFn1sy1xl/LUkeN6Pqp8MBPcFBSYskud5esg7N DZzQ== X-Gm-Message-State: AOAM5320g+070EetYYHMAsPmCEDI6YFviFMWs5merKOaRuuwxXCw5F30 VXgoUY82zzRhUVb407RNv0cUGZ/4eBIhl8Qbg8tTgyi0GWrnVIwyJamPnVcsjJjfZ7enqYoiW4Y RKr2sqnMPeEbOwmILgkh86sZczY9YFHeeDgR/wl+xl+pr9nm+BV6Lhhjp3irStzngvJr0C3QyuH Ln X-Google-Smtp-Source: ABdhPJzLdIBZRgayrpC0Ct3qJXQAyOs4ur2F+UwoboPnA00a/JelafiId1SD2nGvsdjNludNJJd48g== X-Received: by 2002:adf:9d44:: with SMTP id o4mr150803wre.361.1601279666293; Mon, 28 Sep 2020 00:54:26 -0700 (PDT) Received: from [192.168.0.107] (cpc159317-cmbg20-2-0-cust117.5-4.cable.virginm.net. [81.111.29.118]) by smtp.gmail.com with ESMTPSA id q20sm172118wmj.5.2020.09.28.00.54.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Sep 2020 00:54:25 -0700 (PDT) From: Marco Barisione Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: [PING] Add a way to invoke redefined (overridden) GDB commands Date: Mon, 28 Sep 2020 08:54:24 +0100 References: <20200914093925.5442-1-mbarisione@undo.io> To: gdb-patches@sourceware.org In-Reply-To: <20200914093925.5442-1-mbarisione@undo.io> Message-Id: X-Mailer: Apple Mail (2.3445.104.8) X-Spam-Status: No, score=-3.8 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, 28 Sep 2020 07:54:29 -0000 Ping for the patch series at = https://sourceware.org/pipermail/gdb-patches/2020-September/171829.html. Thanks! > On 14 Sep 2020, at 10:39, Marco Barisione wrote: >=20 > Currently, when a GDB command is redefined, the original = implementation is not > available any more. This makes it difficult to build features on top = of > existing commands. >=20 > Last year I submitted a patch to fix this but I ran out of time to = address the > review comments (the original patch was sent on the 28th of October = 2019). > These patches restart that work and should address all the comments I = got last > time. As the patchea are very different and a long time passed, I'm > submitting as a new series. >=20 > My patches add a new "uplevel" command and a new = gdb.Command.invoke_uplevel > method inspired by TCL (as initially suggested by Andrew Burgess) so = you can > do this: >=20 > (gdb) define run > echo Will run!\n > uplevel 0 run > end > (gdb) run > Will run! > [... normal output of run ...] >=20 >=20 > There are a couple of other things which could be added to make the = "uplevel" > command more helpful, but I think they are out of scope and my patches = are > already useful as they are. >=20 > The first thing is adding a way of accessing the untokenised arguments = to a > command via something like "$arg@" (Andrew Burgess suggested "$argv", = but > Pedro Alves pointed out that would look like an argument vector). >=20 > Another thing which could be added is the ability to do "uplevel -1 = ..." to > access the directly redefined command. > This is implemented in Python but I couldn't find an obvious way of = doing that > for the "uplevel" command as there's no way of knowing which command = you are > currently executing (at least from what I could see). > Maybe it could be implemented in a similar way to how command = arguments are > kept around with scoped_user_args_level, so we could keep a stack of = all (user > and non-user) commands which are being executed. By checking the = latest one > you can know what "uplevel -1" would apply to. >=20 --=20 Marco Barisione