X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fcli%2Fcli-option.h;h=a26b52f7f29c92fb21bd7deab49442d99a2a5034;hb=3d9be6f531db395a5ad940ef06e56d849f4de646;hp=1bfbfce1ce512991f85f6afaa13274a99fa57df5;hpb=41fc454c915057d9c5536617370c5eb2a5f71323;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/cli/cli-option.h b/gdb/cli/cli-option.h index 1bfbfce1ce..a26b52f7f2 100644 --- a/gdb/cli/cli-option.h +++ b/gdb/cli/cli-option.h @@ -86,6 +86,7 @@ public: unsigned int *(*uinteger) (const option_def &, void *ctx); int *(*integer) (const option_def &, void *ctx); const char **(*enumeration) (const option_def &, void *ctx); + char **(*string) (const option_def &, void *ctx); } var_address; @@ -261,6 +262,26 @@ struct enum_option_def : option_def } }; +/* A var_string command line option. */ + +template +struct string_option_def : option_def +{ + string_option_def (const char *long_option_, + char **(*get_var_address_cb_) (Context *), + show_value_ftype *show_cmd_cb_, + const char *set_doc_, + const char *show_doc_ = nullptr, + const char *help_doc_ = nullptr) + : option_def (long_option_, var_string, + (erased_get_var_address_ftype *) get_var_address_cb_, + show_cmd_cb_, + set_doc_, show_doc_, help_doc_) + { + var_address.enumeration = detail::get_var_address; + } +}; + /* A group of options that all share the same context pointer to pass to the options' get-current-value callbacks. */ struct option_def_group