[PATCH 4/4] gdb: Add support for renaming commands

Eli Zaretskii eliz@gnu.org
Fri Jan 8 10:30:47 GMT 2021


> Date: Fri,  8 Jan 2021 10:07:06 +0000
> From: Marco Barisione via Gdb-patches <gdb-patches@sourceware.org>
> 
> gdb/ChangeLog:
> 
> 	* NEWS: Add items for the new rename command, the new
> 	-rename-existing-to option for define and the new
> 	rename_existing_to argument for gdb.Command.__init__.
> 	* cli/cli-decode.c (delete_cmd): Rename to disconnect_cmd.
> 	(disconnect_cmd): Disconnect a command from other commands and
> 	lists rather than deleting the command.
> 	(delete_cmd_by_name): Add.
> 	(update_prefix_links): Add.
> 	(update_cmd): Add.
> 	(do_add_cmd): Add ability to rename existing commands rather
> 	than redefining them.
> 	(add_cmd): Ditto.
> 	(add_prefix_cmd): Ditto.
> 	(add_alias_cmd): Update to use disconnect_cmd.
> 	(break_cmd_relationships): Add.
> 	(rename_hook): Add.
> 	(user_defined_command): Move from cli/cli-script.c.
> 	(rename_cmd): Add.
> 	* cli/cli-decode.h (struct cmd_list_element): Call the destroyer
> 	function from the destructor and always free the prefixname.
> 	* cli/cli-script.c (do_define_command): Add ability to rename
> 	existing commands rather than redefining them.
> 	(user_defined_command): Move to cli/cli-decode.c
> 	(check_command_redefinition): Add.
> 	(enum cmd_hook_type): Move from do_define_command to the global
> 	scope.
> 	(get_hook_type): Add.
> 	(HOOK_STRING): Make a variable in get_hook_type.
> 	(HOOK_LEN): Ditto.
> 	(HOOK_POST_STRING): Ditto.
> 	(HOOK_POST_LEN): Ditto.
> 	(struct define_cmd_opts): Add.
> 	(make_define_cmd_options_def_group): Add.
> 	(define_command): Add -rename-existing-to option.
> 	(do_rename_command): Add.
> 	(rename_command): Add.
> 	(_initialize_cli_script): Add option parsing for the define
> 	command and add the rename command.
> 	* command.h (add_cmd): Add ability to rename existing commands
> 	rather than redefining them.
> 	(add_prefix_cmd): Ditto.
> 	(rename_cmd): Add.
> 	(user_defined_command): Add declaration of previously static
> 	function.
> 	* python/py-cmd.c (cmdpy_init): Add rename_existing_to argument.
> 
> gdb/doc/ChangeLog:
> 
> 	* gdb.texinfo: Document the new rename command and the new
> 	-rename-existing-to option for define.
> 	* python.texi: Document the new rename_existing_to argument for
> 	gdb.Command.__init__.
> 
> gdb/testsuite/ChangeLog:
> 
> 	* gdb.base/command-renaming.exp: New test.
> 	* gdb.python/py-rename-existing.exp: New test.
> 	* gdb.python/py-rename-existing.py: New test.

Thanks, the documentation parts are OK.


More information about the Gdb-patches mailing list