8sa1-binutils-gdb/gdb/cli
Philippe Waroquiers b65b566cdc Fix alias command not detecting non matching prefix & sometimes asserting.
alias_command does not detect that the prefixes of the alias command and the
aliased command are not matching: it is comparing the alias prefix
with itself, instead of comparing it with the aliased command prefix.

This causes either the alias command to silently do nothing,
or to have GDB asserting:
    (gdb) alias assigne imprime limite-elements = set print elements
    ../../binutils-gdb/gdb/cli/cli-cmds.c:1552: internal-error: void alias_command(const char*, int): Assertion `c_command != NULL && c_command != (struct cmd_list_element *) -1' failed.
    A problem internal to GDB has been detected,

Fix the logic, and update gdb.base/alias.exp to test these cases.

gdb/ChangeLog
2019-06-25  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* cli/cli-cmds.c (alias_command): Compare the alias prefix
	with the command prefix.

gdb/testsuite/ChangeLog
2019-06-25  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* gdb.base/alias.exp: Test non matching/non existing prefixes.
2019-06-25 19:15:16 +02:00
..
cli-cmds.c Fix alias command not detecting non matching prefix & sometimes asserting. 2019-06-25 19:15:16 +02:00
cli-cmds.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
cli-decode.c "set print raw frame-arguments" -> "set print raw-frame-arguments" 2019-06-13 00:18:41 +01:00
cli-decode.h Introduce generic command options framework 2019-06-13 00:18:12 +01:00
cli-dump.c Introduce and use make_unique_xstrdup 2019-06-04 22:48:32 +01:00
cli-interp.c Add debug redirect option 2019-05-17 14:21:47 +01:00
cli-interp.h Add debug redirect option 2019-05-17 14:21:47 +01:00
cli-logging.c Do not emit style escape sequences to log file 2019-06-14 14:13:29 -06:00
cli-option.c Introduce generic command options framework 2019-06-13 00:18:12 +01:00
cli-option.h Introduce generic command options framework 2019-06-13 00:18:12 +01:00
cli-script.c Replace throw_exception with throw in some cases 2019-04-08 09:05:41 -06:00
cli-script.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
cli-setshow.c Remove unnecessary casts of NULL 2019-06-16 09:59:03 -06:00
cli-setshow.h Introduce generic command options framework 2019-06-13 00:18:12 +01:00
cli-style.c Add highlight style, title style, fputs_highlighted. Improve 'show style' 2019-06-03 21:59:11 +02:00
cli-style.h Add highlight style, title style, fputs_highlighted. Improve 'show style' 2019-06-03 21:59:11 +02:00
cli-utils.c Delete parse_flags/parse_flags_qcs 2019-06-13 00:24:17 +01:00
cli-utils.h Delete parse_flags/parse_flags_qcs 2019-06-13 00:24:17 +01:00