binutils-gdb/gdb/cli
Yao Qi 21873064e8 Add alias command to cmd_list_element
When we add alias command, we call add_alias_cmd and pass the alias name
and command name.  This implicitly requires the command and its prefix
commands are already added to cmdlist.  This may not be true, for example,

  add_com_alias ("tty", "set inferior-tty", class_alias, 0);

"inferior-tty" command is added to setlist, but setlist may not be added
to cmdlist (It depends on the order of related _initialize_XXX functions
called) so that we can't find "set inferior-tty" from cmdlist.

This patch fixes this problem by passing cmd_list_element of "inferior-tty"
to add_alias_cmd, so that cmd_list_element of "inferior-tty" doesn't have
to be reachable from cmdlist at that moment.

gdb:

2017-05-17  Yao Qi  <yao.qi@linaro.org>

	* cli/cli-decode.c (add_alias_cmd): New function.
	* command.h (add_alias_cmd): Declare.
	* infcmd.c (_initialize_infcmd): Don't call add_com_alias,
	instead call add_alias_cmd.

gdb/testsuite:

2017-05-17  Simon Marchi  <simon.marchi@ericsson.com>

	* gdb.base/set-inferior-tty.exp (test_set_inferior_tty): Add
	argument command.
	(top-level): Invoke test_set_inferior_tty.
2017-05-17 14:22:35 +01:00
..
cli-cmds.c Introduce event_location_up 2017-04-12 11:16:17 -06:00
cli-cmds.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
cli-decode.c Add alias command to cmd_list_element 2017-05-17 14:22:35 +01:00
cli-decode.h Command abbreviation in define 2017-02-08 19:03:25 +01:00
cli-dump.c -Wwrite-strings: The Rest 2017-04-05 19:21:37 +01:00
cli-interp.c C++-fy struct interp/cli_interp/tui_interp/mi_interp 2017-02-03 16:30:04 +00:00
cli-interp.h C++-fy struct interp/cli_interp/tui_interp/mi_interp 2017-02-03 16:30:04 +00:00
cli-logging.c Move "tee" building down to interpreter::set_logging_proc 2017-02-02 22:00:43 +00:00
cli-script.c Introduce command_line_up 2017-04-12 11:16:17 -06:00
cli-script.h Introduce command_line_up 2017-04-12 11:16:17 -06:00
cli-setshow.c Use ui_out_emit_tuple 2017-04-22 09:46:58 -06:00
cli-setshow.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
cli-utils.c -Wwrite-strings: Some constification in gdb/breakpoint.c 2017-04-05 19:21:36 +01:00
cli-utils.h -Wwrite-strings: Some constification in gdb/breakpoint.c 2017-04-05 19:21:36 +01:00