binutils-gdb/gdb/cli
Simon Marchi 3947f654ea gdb: make add_com_alias accept target as a cmd_list_element
The alias creation functions currently accept a name to specify the
target command.  They pass this to add_alias_cmd, which needs to lookup
the target command by name.

Given that:

 - We don't support creating an alias for a command before that command
   exists.
 - We always use add_info_alias just after creating that target command,
   and therefore have access to the target command's cmd_list_element.

... change add_com_alias to accept the target command as a
cmd_list_element (other functions are done in subsequent patches).  This
ensures we don't create the alias before the target command, because you
need to get the cmd_list_element from somewhere when you call the alias
creation function.  And it avoids an unecessary command lookup.  So it
seems better to me in every aspect.

gdb/ChangeLog:

	* command.h (add_com_alias): Accept target as
	cmd_list_element.  Update callers.

Change-Id: I24bed7da57221cc77606034de3023fedac015150
2021-05-27 14:00:07 -04:00
..
cli-cmds.c gdb: make add_com_alias accept target as a cmd_list_element 2021-05-27 14:00:07 -04:00
cli-cmds.h
cli-decode.c gdb: make add_com_alias accept target as a cmd_list_element 2021-05-27 14:00:07 -04:00
cli-decode.h gdb: add cmd_list_element::is_command_class_help 2021-05-17 14:01:32 -04:00
cli-dump.c gdb: generate the prefix name for prefix commands on demand 2021-05-12 11:19:22 +01:00
cli-interp.c
cli-interp.h
cli-logging.c gdb: generate the prefix name for prefix commands on demand 2021-05-12 11:19:22 +01:00
cli-option.c
cli-option.h
cli-script.c cli-script: use unique_ptr to not leak next struct 2021-05-20 21:03:47 +02:00
cli-script.h cli-script: use unique_ptr to not leak next struct 2021-05-20 21:03:47 +02:00
cli-setshow.c gdb: Pass std::strings to ui_out::field_string () where convenient 2021-05-19 13:58:41 +01:00
cli-setshow.h
cli-style.c gdb: generate the prefix name for prefix commands on demand 2021-05-12 11:19:22 +01:00
cli-style.h gdb: generate the prefix name for prefix commands on demand 2021-05-12 11:19:22 +01:00
cli-utils.c
cli-utils.h