binutils-gdb/gdb/cli
Andrew Burgess 021d8588f6 gdb: Allow quoting around string options in the gdb::option framework
Currently string options must be a single string with no whitespace,
this limitation prevents the gdb::option framework being used in some
places.

After this commit, string options can be quoted in single or double
quotes, and quote characters can be escaped with a backslash if needed
to either place them within quotes, or to avoid starting a quoted
argument.

This test adds a new function extract_string_maybe_quoted which is
basically a copy of extract_arg_maybe_quoted from cli/cli-utils.c,
however, the cli-utils.c function will be deleted in the next commit.

There are tests to exercise the new quoting mechanism.

gdb/ChangeLog:

	* cli/cli-option.c (parse_option): Use extract_string_maybe_quoted
	to extract string arguments.
	* common/common-utils.c (extract_string_maybe_quoted): New function.
	* common/common-utils.h (extract_string_maybe_quoted): Declare.

gdb/testsuite/ChangeLog:

	* gdb.base/options.exp (expect_string): Dequote strings in
	results.
	(test-string): Test strings with different quoting and reindent.
2019-07-11 20:18:11 +01:00
..
cli-cmds.c Remove init_cli_cmds 2019-07-11 10:28:27 -06:00
cli-cmds.h Remove init_cli_cmds 2019-07-11 10:28:27 -06:00
cli-decode.c Rename common to gdbsupport 2019-07-09 07:45:38 -06:00
cli-decode.h Don't include gdbarch.h from defs.h 2019-07-10 14:53:53 -06:00
cli-dump.c Don't include gdbarch.h from defs.h 2019-07-10 14:53:53 -06: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 gdb: Allow quoting around string options in the gdb::option framework 2019-07-11 20:18:11 +01:00
cli-option.h Rename common to gdbsupport 2019-07-09 07:45:38 -06:00
cli-script.c Rename common to gdbsupport 2019-07-09 07:45:38 -06:00
cli-script.h Don't include gdbarch.h from defs.h 2019-07-10 14:53:53 -06:00
cli-setshow.c Introduce the "with" command 2019-07-03 13:35:45 +01:00
cli-setshow.h Introduce the "with" command 2019-07-03 13:35:45 +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 Don't include gdbarch.h from defs.h 2019-07-10 14:53:53 -06:00
cli-utils.c Make gdb::option::complete_options save processed arguments too 2019-07-03 16:58:30 +01:00
cli-utils.h Delete parse_flags/parse_flags_qcs 2019-06-13 00:24:17 +01:00