binutils-gdb/gdb/cli
Sergio Durigan Junior dc4bde35d1 PR cli/21688: Detect aliases when issuing python/compile/guile commands (and fix last commit)
My last commit fixed a regression that happened when using
inline/multi-line commands for Python/Compile/Guile, but introduced
another regression: it is now not possible to use aliases for the
commands mentioned above.  The fix is to almost revert the change I've
made and go back to using the 'struct cmd_list_element *', but at the
same time make sure that we advance the 'cmd_name' variable past all
the whitespace characters after the command name.  If, after skipping
the whitespace, we encounter a '\0', it means that the command is not
inline.  Otherwise, it is.

This patch also expands the testcase in order to check for aliases and
for trailing whitespace after the command name.

gdb/ChangeLog:
2017-06-30  Sergio Durigan Junior  <sergiodj@redhat.com>
	    Pedro Alves  <palves@redhat.com>

	PR cli/21688
	* cli/cli-script.c (command_name_equals_not_inline): Remove function.
	(process_next_line): New variable 'inline_cmd'.
	Adjust 'if' clauses for "python", "compile" and "guile" to use
	'command_name_equals' and check for '!inline_cmd'.

gdb/testsuite/ChangeLog:
2017-06-30  Sergio Durigan Junior  <sergiodj@redhat.com>

	PR cli/21688
	* gdb.python/py-cmd.exp (test_python_inline_or_multiline): Add new
	tests for alias commands and trailing whitespace.
2017-06-30 09:31:21 -04:00
..
cli-cmds.c Introduce compiled_regex, eliminate make_regfree_cleanup 2017-06-07 14:21:40 +01:00
cli-cmds.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
cli-decode.c Introduce compiled_regex, eliminate make_regfree_cleanup 2017-06-07 14:21:40 +01:00
cli-decode.h Introduce compiled_regex, eliminate make_regfree_cleanup 2017-06-07 14:21:40 +01:00
cli-dump.c Introduce gdb::byte_vector, add allocator that default-initializes 2017-06-14 11:08:52 +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 PR cli/21688: Detect aliases when issuing python/compile/guile commands (and fix last commit) 2017-06-30 09:31:21 -04: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