diff options
author | Yao Qi <yao@codesourcery.com> | 2013-08-27 03:04:45 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2013-08-27 03:04:45 +0000 |
commit | 242f1fd7ee29538968e32155c99a36c3d7604eb5 (patch) | |
tree | 63842883ad96777ca1f546e358c1456d6fea4618 /gdb/mi/mi-getopt.h | |
parent | e5034e59e04c90d3a0b6c78af0cbfd3f73eb7809 (diff) | |
download | gdb-242f1fd7ee29538968e32155c99a36c3d7604eb5.zip gdb-242f1fd7ee29538968e32155c99a36c3d7604eb5.tar.gz gdb-242f1fd7ee29538968e32155c99a36c3d7604eb5.tar.bz2 |
Add mi_getopt_allow_unknown
This patch is to add a new function mi_getopt_allow_unknown, which
returns -1 silently (without throwing error) when unknown option is
met, and use this function to parse options for command
'-stack-list-arguments'.
gdb/
* mi/mi-cmd-stack.c (parse_no_frames_option): Remove.
(mi_cmd_stack_list_args): Use mi_getopt_silent to handle
options.
* mi/mi-getopt.c (mi_getopt): Remove.
(mi_getopt_1): Renamed from mi_getopt. Add one parameter
'error_on_unknown'.
(mi_getopt): Call mi_getopt_1.
(mi_getopt_silent): New.
* mi/mi-getopt.h (mi_getopt_silent): Declare.
Diffstat (limited to 'gdb/mi/mi-getopt.h')
-rw-r--r-- | gdb/mi/mi-getopt.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gdb/mi/mi-getopt.h b/gdb/mi/mi-getopt.h index 9600353..7db0bf4 100644 --- a/gdb/mi/mi-getopt.h +++ b/gdb/mi/mi-getopt.h @@ -46,11 +46,15 @@ struct mi_opt If ARGV[OPTIND] is not an option, -1 is returned and OPTIND updated to specify the non-option argument. OPTARG is set to NULL. - mi_getopt() calls ``error("%s: Unknown option %c", prefix, - option)'' if an unknown option is encountered. */ + If an unknown option is encountered, mi_getopt() calls + ``error("%s: Unknown option %c", prefix, option)'' while + mi_getopt_allow_unknown returns -1. */ extern int mi_getopt (const char *prefix, int argc, char **argv, const struct mi_opt *opt, int *optind, char **optarg); +extern int mi_getopt_allow_unknown (const char *prefix, int argc, + char **argv, const struct mi_opt *opts, + int *oind, char **oarg); /* mi_valid_noargs determines if ARGC/ARGV are a valid set of parameters to satisfy an MI function that is not supposed to |