binutils-gdb/gdb/cli
Tom Tromey 7a2c85f259 Allow defining a user command inside a user command
PR gdb/11750 concerns defining a command inside a user commnad, like:

    define outer
      define inner
	echo hi\n
      end
    end

This patch adds this capability to gdb.

ChangeLog
2018-05-04  Tom Tromey  <tom@tromey.com>

	PR gdb/11750:
	* cli/cli-script.h (enum command_control_type) <define_control>:
	New constant.
	* cli/cli-script.c (multi_line_command_p): Handle define_control.
	(build_command_line, execute_control_command_1)
	(process_next_line): Likewise.
	(do_define_command): New function, extracted from define_command.
	(define_command): Use it.

testsuite/ChangeLog
2018-05-04  Tom Tromey  <tom@tromey.com>

	PR gdb/11750:
	* gdb.base/define.exp: Test defining a user command inside a user
	command.
	* gdb.base/commands.exp (define_if_without_arg_test): Test "define".
2018-05-04 15:58:07 -06:00
..
cli-cmds.c Change openp et al to use a unique_xmalloc_ptr 2018-02-14 08:09:53 -07:00
cli-cmds.h Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00
cli-decode.c Allocate cmd_list_element with new 2018-05-04 15:58:05 -06:00
cli-decode.h Use counted_command_line everywhere 2018-05-04 15:58:06 -06:00
cli-dump.c Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00
cli-interp.c Convert observers to C++ 2018-03-19 09:37:49 -06:00
cli-interp.h Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00
cli-logging.c Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00
cli-script.c Allow defining a user command inside a user command 2018-05-04 15:58:07 -06:00
cli-script.h Allow defining a user command inside a user command 2018-05-04 15:58:07 -06:00
cli-setshow.c Convert observers to C++ 2018-03-19 09:37:49 -06:00
cli-setshow.h Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00
cli-utils.c Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00
cli-utils.h Update copyright year range in all GDB files 2018-01-02 07:38:06 +04:00