From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id FKtjFmbOel+9fQAAWB0awg (envelope-from ) for ; Mon, 05 Oct 2020 03:42:30 -0400 Received: by simark.ca (Postfix, from userid 112) id 43B981E58D; Mon, 5 Oct 2020 03:42:30 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID,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 DE2791E58D for ; Mon, 5 Oct 2020 03:42:28 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 448223857C62; Mon, 5 Oct 2020 07:42:28 +0000 (GMT) Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id 5FBB03857C62 for ; Mon, 5 Oct 2020 07:42:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5FBB03857C62 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-wm1-x335.google.com with SMTP id k18so7687199wmj.5 for ; Mon, 05 Oct 2020 00:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=undo-io.20150623.gappssmtp.com; s=20150623; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=LJcLh7k1OXbtQTtYgV1K0+veF6Wx5bxIPNorYxebe9Q=; b=eyF0lPhyXuMfqd2fF11JTbSMLpmxHWYBAVMNlCChcwAa5C3vZcvw/3yWGFiLN3PbnA uVOxWNZMihNq+prZP/gA4CgqBYERuRuJrmNPgfQ7FEIQulyVz0TTB9+iiXxZzX8746bx LnutL6a93SGNz1HMKT7AEbF9DBhK5aWT3rF+Q6f896QehTPzHw5Pu8bvpEAUbU4dsD23 YfzgnNRiv8zc+X2s3QZJh4gbUkO8TuH99jfQ2yc7Yd2fpl5ATar65avX85i+CZDCWH4c NlcXhfB5/fRWore1CY0q2iXOaSMYBEAN4DBlSq2oB0S77x4fgn2NtaE/cDfPb54zCuQ3 rbtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=LJcLh7k1OXbtQTtYgV1K0+veF6Wx5bxIPNorYxebe9Q=; b=DCIrFFkTqBoKC1jR9XeP9AmCNCDIMhHD+ANwFOyXQeDJH889Y6pDKcFzc4lQ8p9rja eyfs+1YycfOTYVLf4KVTtdKwHqYU/laJS5gixU/Kt/GvMCBJcujJfQaEk+G+gK9/XpVH 7i5Wy3+cxscw64o3Y0kb3veZSpDuK03Gi9++ltkbadPqf+0CwyrsAYwpTcvAwGY48ezH HZgNgPLLI2G7Q1XfYAFZtTWUeCCmF3bDij2hDTyr0LZPel6d6Lps/7DQg+eCfZ1Z+3Qu BHTX5hC8w6ebL2hyiq4udyutwhuOujOcdNNMDh/y0Z2A7ebpJtNkELTQBg8Rh260Rf37 3JIg== X-Gm-Message-State: AOAM532ruO+all/2FgfVmF/kwMdQpyN7xvpeE9kv/v8CVELcs/WV8HHU AtW66yInEBOFzPb8px1ErIHXBNHeUMexs6ftw8tYp+x7y+oKT9E2652A+nCJIBa8yWbIZbmq6mL wcrnaQDOpq0w7HVka8BEPMrS8pZGuoO+3QY9BTWUCL0TuFG4G/sS/2bBrr15oknWHkG00ZGFr8x g8 X-Google-Smtp-Source: ABdhPJyLLLgLvyc3oKkxL/V/LgH3cM7qTLRPHWNj21rbsIo6lJR/Om8cj28mHoL7igNiGxlVKkHyyw== X-Received: by 2002:a1c:c342:: with SMTP id t63mr14904015wmf.145.1601883743866; Mon, 05 Oct 2020 00:42:23 -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 m10sm11844068wmc.9.2020.10.05.00.42.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Oct 2020 00:42:23 -0700 (PDT) From: Marco Barisione Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: [PING] Add a way to invoke redefined (overridden) GDB commands Date: Mon, 5 Oct 2020 08:42:20 +0100 References: <20200914093925.5442-1-mbarisione@undo.io> To: gdb-patches@sourceware.org In-Reply-To: Message-Id: <9C30CFB8-5BDA-40F7-BCF1-7BA184ECB997@undo.io> X-Mailer: Apple Mail (2.3445.104.8) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" Second ping for = https://sourceware.org/pipermail/gdb-patches/2020-September/171829.html = .= > On 28 Sep 2020, at 08:54, Marco Barisione wrote: >=20 > Ping for the patch series at = https://sourceware.org/pipermail/gdb-patches/2020-September/171829.html. >=20 > Thanks! >=20 >=20 >> 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 > --=20 > Marco Barisione >=20 --=20 Marco Barisione