From: Eli Zaretskii <eliz@gnu.org>
To: Marco Barisione <mbarisione@undo.io>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] Add a way to preserve redefined GDB commands for later invocation
Date: Mon, 14 Sep 2020 19:18:23 +0300 [thread overview]
Message-ID: <83lfhc9vsg.fsf@gnu.org> (raw)
In-Reply-To: <20200914093925.5442-3-mbarisione@undo.io> (message from Marco Barisione on Mon, 14 Sep 2020 09:39:25 +0000)
> From: Marco Barisione <mbarisione@undo.io>
> Date: Mon, 14 Sep 2020 09:39:25 +0000
>
> When a command was redefined, the functionality of the original command
> used to be lost, making it difficult to extend existing commands.
>
> This patch adds an uplevel command (inspired by the TCL command with the
> same name) which allows access to previous implementations of commands
> and a gdb.Command.invoke_uplevel Python method to do the same.
>
> gdb/ChangeLog:
>
> * NEWS: Document the addition of the uplevel command and the
> gdb.Command.invoke_uplevel Python method.
> * cli/cli-decode.c (delete_cmd): Rename to remove_cmd.
> (do_add_cmd): Keep the removed command and and update the chain
> of inmplementations of the same command.
> (add_alias_cmd): Update to reflect the changes to delete_cmd.
> (remove_cmd): Rename from delete_cmd. Preserve removed commands,
> but not aliases, and return them.
> (lookup_uplevel_cmd): Lookup an implementation of a command based
> on a cmd_list_element of the same name and a level.
> * cli/cli-decode.h (struct cmd_list_element): Add uplevel_cmd and
> downlevel_cmd to keep track of redefined commands and commands
> which redefined them.
> * cli/cli-script.c (uplevel_command): Implementation of the
> uplevel command.
> * command.h: Add declaration of lookup_uplevel_cmd.
> * python/py-cmd.c (cmdpy_invoke_uplevel): Implementation of the
> gdb.Command.invoke_uplevel method.
>
> gdb/doc/ChangeLog:
>
> * gdb/doc/gdb.texinfo: Document the uplevel command.
> * python.texi: Document the gdb.Command.invoke_uplevel method.
>
> gdb/testsuite/ChangeLog:
>
> * gdb.base/uplevel.exp: New file to test the uplevel command.
> * gdb.python/py-invoke-uplevel.exp: New file to test the
> gdb.Command.invoke_uplevel method.
> * gdb.python/py-invoke-uplevel.py: New test.
Thanks, the documentation parts are okay.
Though I wonder whether 'uplevel' is really the best name for this.
(No, I don't write Python.)
next prev parent reply other threads:[~2020-09-14 16:18 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-14 9:39 Add a way to invoke redefined (overridden) GDB commands Marco Barisione
2020-09-14 9:39 ` [PATCH 1/2] Move the code to execute a cmd_list_element out from execute_command Marco Barisione
2020-10-05 9:08 ` Andrew Burgess
2020-10-05 9:40 ` Marco Barisione
2020-10-05 17:49 ` Andrew Burgess
2020-09-14 9:39 ` [PATCH 2/2] Add a way to preserve redefined GDB commands for later invocation Marco Barisione
2020-09-14 16:18 ` Eli Zaretskii [this message]
2020-09-14 16:51 ` Marco Barisione
2020-10-05 10:24 ` Andrew Burgess
2020-10-05 11:44 ` Marco Barisione
2020-10-05 18:11 ` Andrew Burgess
2020-10-06 7:18 ` Marco Barisione
2020-09-28 7:54 ` [PING] Add a way to invoke redefined (overridden) GDB commands Marco Barisione
2020-10-05 7:42 ` Marco Barisione
2020-10-12 11:50 ` Pedro Alves
2020-10-19 17:41 ` Marco Barisione
2020-10-19 18:05 ` Pedro Alves
2020-10-19 18:47 ` Philippe Waroquiers
2020-10-19 19:28 ` Marco Barisione
2020-10-20 15:06 ` Pedro Alves
2020-10-20 18:19 ` Marco Barisione
2020-10-20 18:32 ` Pedro Alves
2020-10-20 15:15 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83lfhc9vsg.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=mbarisione@undo.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).