New cli-utils.h/.c function extract_info_print_args
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sun, 1 Jul 2018 20:46:41 +0000 (22:46 +0200)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 27 Oct 2018 11:45:57 +0000 (13:45 +0200)
commit0d4cad90ca7c4394a1799efaa79c784f84a18161
treed1b0f869265df959bcba8f94b47442eb446520b8
parent6951e9f3e219cb6867beccb48dde39530e48d582
New cli-utils.h/.c function extract_info_print_args

New cli-utils.h/.c function extract_info_print_args factorizes
the extraction of the args '[-q] [-t TYPEREGEXP] [NAMEREGEXP]'.
New cli-utils.h/.c function report_unrecognized_option_error
factorizes reporting an unknown option for a command.

These functions will be used by the commands
  info [args|functions|locals|variables]

As extract_info_print_args will be used for 'info functions|variables' which
already have the NAMEREGEXP arg, it provides a backward compatible
behaviour.

cli-utils.c has a new static function extract_arg_maybe_quoted
that extracts an argument, possibly quoted.  The behaviour of this
function is similar to the parsing done by gdb_argv.

gdb/ChangeLog
2018-10-27  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* cli-utils.c (extract_arg_maybe_quoted): New function.
(extract_info_print_args): New function.
(info_print_args_help): New function.
(report_unrecognized_option_error): New function.
* cli-utils.h (extract_arg_maybe_quoted): New function.
(extract_info_print_args): New function.
(info_print_args_help): New function.
(report_unrecognized_option_error): New function.
gdb/ChangeLog
gdb/cli/cli-utils.c
gdb/cli/cli-utils.h