gdb: make add_setshow commands return set_show_commands

Some add_set_show commands return a single cmd_list_element, the one for
the "set" command.  A subsequent patch will need to access the show
command's cmd_list_element as well.  Change these functions to return a
new structure type that holds both pointers.

I initially only modified add_setshow_boolean_cmd (the one I needed),
but I think it's better to change the whole chain to keep everything in
sync.

gdb/ChangeLog:

	* command.h (set_show_commands): New.
	(add_setshow_enum_cmd, add_setshow_auto_boolean_cmd,
	add_setshow_boolean_cmd, add_setshow_filename_cmd,
	add_setshow_string_cmd, add_setshow_string_noescape_cmd,
	add_setshow_optional_filename_cmd, add_setshow_integer_cmd,
	add_setshow_uinteger_cmd, add_setshow_zinteger_cmd,
	add_setshow_zuinteger_cmd, add_setshow_zuinteger_unlimited_cmd):
	Return set_show_commands.  Adjust callers.
	* cli/cli-decode.c (add_setshow_cmd_full): Return
	set_show_commands, remove result parameters, adjust callers.

Change-Id: I17492b01b76002d09effc84830f9c6db26f1db7a
This commit is contained in:
Simon Marchi
2021-05-27 13:59:00 -04:00
parent 868027a48b
commit af7f8f52dd
7 changed files with 210 additions and 253 deletions

View File

@ -1,3 +1,16 @@
2021-05-27 Simon Marchi <simon.marchi@polymtl.ca>
* command.h (set_show_commands): New.
(add_setshow_enum_cmd, add_setshow_auto_boolean_cmd,
add_setshow_boolean_cmd, add_setshow_filename_cmd,
add_setshow_string_cmd, add_setshow_string_noescape_cmd,
add_setshow_optional_filename_cmd, add_setshow_integer_cmd,
add_setshow_uinteger_cmd, add_setshow_zinteger_cmd,
add_setshow_zuinteger_cmd, add_setshow_zuinteger_unlimited_cmd):
Return set_show_commands. Adjust callers.
* cli/cli-decode.c (add_setshow_cmd_full): Return
set_show_commands, remove result parameters, adjust callers.
2021-05-27 Tom de Vries <tdevries@suse.de> 2021-05-27 Tom de Vries <tdevries@suse.de>
PR symtab/27919 PR symtab/27919

View File

@ -531,11 +531,11 @@ add_set_or_show_cmd (const char *name,
setting. VAR is address of the variable being controlled by this setting. VAR is address of the variable being controlled by this
command. SET_FUNC and SHOW_FUNC are the callback functions (if command. SET_FUNC and SHOW_FUNC are the callback functions (if
non-NULL). SET_DOC, SHOW_DOC and HELP_DOC are the documentation non-NULL). SET_DOC, SHOW_DOC and HELP_DOC are the documentation
strings. PRINT the format string to print the value. SET_RESULT strings.
and SHOW_RESULT, if not NULL, are set to the resulting command
structures. */
static void Return the newly created set and show commands. */
static set_show_commands
add_setshow_cmd_full (const char *name, add_setshow_cmd_full (const char *name,
enum command_class theclass, enum command_class theclass,
var_types var_type, void *var, var_types var_type, void *var,
@ -544,9 +544,7 @@ add_setshow_cmd_full (const char *name,
cmd_const_sfunc_ftype *set_func, cmd_const_sfunc_ftype *set_func,
show_value_ftype *show_func, show_value_ftype *show_func,
struct cmd_list_element **set_list, struct cmd_list_element **set_list,
struct cmd_list_element **show_list, struct cmd_list_element **show_list)
struct cmd_list_element **set_result,
struct cmd_list_element **show_result)
{ {
struct cmd_list_element *set; struct cmd_list_element *set;
struct cmd_list_element *show; struct cmd_list_element *show;
@ -578,10 +576,7 @@ add_setshow_cmd_full (const char *name,
for the "show" command to complete on anything. */ for the "show" command to complete on anything. */
set_cmd_completer (show, nullptr); set_cmd_completer (show, nullptr);
if (set_result != NULL) return {set, show};
*set_result = set;
if (show_result != NULL)
*show_result = show;
} }
/* Add element named NAME to command list LIST (the list for set or /* Add element named NAME to command list LIST (the list for set or
@ -589,7 +584,7 @@ add_setshow_cmd_full (const char *name,
of strings which may follow NAME. VAR is address of the variable of strings which may follow NAME. VAR is address of the variable
which will contain the matching string (from ENUMLIST). */ which will contain the matching string (from ENUMLIST). */
void set_show_commands
add_setshow_enum_cmd (const char *name, add_setshow_enum_cmd (const char *name,
enum command_class theclass, enum command_class theclass,
const char *const *enumlist, const char *const *enumlist,
@ -603,17 +598,17 @@ add_setshow_enum_cmd (const char *name,
struct cmd_list_element **show_list, struct cmd_list_element **show_list,
void *context) void *context)
{ {
struct cmd_list_element *c, *show; set_show_commands commands
= add_setshow_cmd_full (name, theclass, var_enum, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list);
commands.set->enums = enumlist;
add_setshow_cmd_full (name, theclass, var_enum, var, set_cmd_context (commands.set, context);
set_doc, show_doc, help_doc, set_cmd_context (commands.show, context);
set_func, show_func,
set_list, show_list,
&c, &show);
c->enums = enumlist;
set_cmd_context (c, context); return commands;
set_cmd_context (show, context);
} }
/* See cli-decode.h. */ /* See cli-decode.h. */
@ -623,7 +618,8 @@ const char * const auto_boolean_enums[] = { "on", "off", "auto", NULL };
command list lists. CLASS is as in add_cmd. VAR is address of the command list lists. CLASS is as in add_cmd. VAR is address of the
variable which will contain the value. DOC is the documentation variable which will contain the value. DOC is the documentation
string. FUNC is the corresponding callback. */ string. FUNC is the corresponding callback. */
void
set_show_commands
add_setshow_auto_boolean_cmd (const char *name, add_setshow_auto_boolean_cmd (const char *name,
enum command_class theclass, enum command_class theclass,
enum auto_boolean *var, enum auto_boolean *var,
@ -634,14 +630,15 @@ add_setshow_auto_boolean_cmd (const char *name,
struct cmd_list_element **set_list, struct cmd_list_element **set_list,
struct cmd_list_element **show_list) struct cmd_list_element **show_list)
{ {
struct cmd_list_element *c; set_show_commands commands
= add_setshow_cmd_full (name, theclass, var_auto_boolean, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list);
add_setshow_cmd_full (name, theclass, var_auto_boolean, var, commands.set->enums = auto_boolean_enums;
set_doc, show_doc, help_doc,
set_func, show_func, return commands;
set_list, show_list,
&c, NULL);
c->enums = auto_boolean_enums;
} }
/* See cli-decode.h. */ /* See cli-decode.h. */
@ -653,7 +650,7 @@ const char * const boolean_enums[] = { "on", "off", NULL };
value. SET_DOC and SHOW_DOC are the documentation strings. value. SET_DOC and SHOW_DOC are the documentation strings.
Returns the new command element. */ Returns the new command element. */
cmd_list_element * set_show_commands
add_setshow_boolean_cmd (const char *name, enum command_class theclass, bool *var, add_setshow_boolean_cmd (const char *name, enum command_class theclass, bool *var,
const char *set_doc, const char *show_doc, const char *set_doc, const char *show_doc,
const char *help_doc, const char *help_doc,
@ -662,21 +659,21 @@ add_setshow_boolean_cmd (const char *name, enum command_class theclass, bool *va
struct cmd_list_element **set_list, struct cmd_list_element **set_list,
struct cmd_list_element **show_list) struct cmd_list_element **show_list)
{ {
struct cmd_list_element *c; set_show_commands commands
= add_setshow_cmd_full (name, theclass, var_boolean, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list);
add_setshow_cmd_full (name, theclass, var_boolean, var, commands.set->enums = boolean_enums;
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list,
&c, NULL);
c->enums = boolean_enums;
return c; return commands;
} }
/* Add element named NAME to both the set and show command LISTs (the /* Add element named NAME to both the set and show command LISTs (the
list for set/show or some sublist thereof). */ list for set/show or some sublist thereof). */
void
set_show_commands
add_setshow_filename_cmd (const char *name, enum command_class theclass, add_setshow_filename_cmd (const char *name, enum command_class theclass,
char **var, char **var,
const char *set_doc, const char *show_doc, const char *set_doc, const char *show_doc,
@ -686,19 +683,21 @@ add_setshow_filename_cmd (const char *name, enum command_class theclass,
struct cmd_list_element **set_list, struct cmd_list_element **set_list,
struct cmd_list_element **show_list) struct cmd_list_element **show_list)
{ {
struct cmd_list_element *set_result; set_show_commands commands
= add_setshow_cmd_full (name, theclass, var_filename, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list);
add_setshow_cmd_full (name, theclass, var_filename, var, set_cmd_completer (commands.set, filename_completer);
set_doc, show_doc, help_doc,
set_func, show_func, return commands;
set_list, show_list,
&set_result, NULL);
set_cmd_completer (set_result, filename_completer);
} }
/* Add element named NAME to both the set and show command LISTs (the /* Add element named NAME to both the set and show command LISTs (the
list for set/show or some sublist thereof). */ list for set/show or some sublist thereof). */
void
set_show_commands
add_setshow_string_cmd (const char *name, enum command_class theclass, add_setshow_string_cmd (const char *name, enum command_class theclass,
char **var, char **var,
const char *set_doc, const char *show_doc, const char *set_doc, const char *show_doc,
@ -708,21 +707,22 @@ add_setshow_string_cmd (const char *name, enum command_class theclass,
struct cmd_list_element **set_list, struct cmd_list_element **set_list,
struct cmd_list_element **show_list) struct cmd_list_element **show_list)
{ {
cmd_list_element *set_cmd; set_show_commands commands
= add_setshow_cmd_full (name, theclass, var_string, var,
add_setshow_cmd_full (name, theclass, var_string, var, set_doc, show_doc, help_doc,
set_doc, show_doc, help_doc, set_func, show_func,
set_func, show_func, set_list, show_list);
set_list, show_list,
&set_cmd, NULL);
/* Disable the default symbol completer. */ /* Disable the default symbol completer. */
set_cmd_completer (set_cmd, nullptr); set_cmd_completer (commands.set, nullptr);
return commands;
} }
/* Add element named NAME to both the set and show command LISTs (the /* Add element named NAME to both the set and show command LISTs (the
list for set/show or some sublist thereof). */ list for set/show or some sublist thereof). */
struct cmd_list_element *
set_show_commands
add_setshow_string_noescape_cmd (const char *name, enum command_class theclass, add_setshow_string_noescape_cmd (const char *name, enum command_class theclass,
char **var, char **var,
const char *set_doc, const char *show_doc, const char *set_doc, const char *show_doc,
@ -732,23 +732,22 @@ add_setshow_string_noescape_cmd (const char *name, enum command_class theclass,
struct cmd_list_element **set_list, struct cmd_list_element **set_list,
struct cmd_list_element **show_list) struct cmd_list_element **show_list)
{ {
struct cmd_list_element *set_cmd; set_show_commands commands
= add_setshow_cmd_full (name, theclass, var_string_noescape, var,
add_setshow_cmd_full (name, theclass, var_string_noescape, var, set_doc, show_doc, help_doc,
set_doc, show_doc, help_doc, set_func, show_func,
set_func, show_func, set_list, show_list);
set_list, show_list,
&set_cmd, NULL);
/* Disable the default symbol completer. */ /* Disable the default symbol completer. */
set_cmd_completer (set_cmd, nullptr); set_cmd_completer (commands.set, nullptr);
return set_cmd; return commands;
} }
/* Add element named NAME to both the set and show command LISTs (the /* Add element named NAME to both the set and show command LISTs (the
list for set/show or some sublist thereof). */ list for set/show or some sublist thereof). */
void
set_show_commands
add_setshow_optional_filename_cmd (const char *name, enum command_class theclass, add_setshow_optional_filename_cmd (const char *name, enum command_class theclass,
char **var, char **var,
const char *set_doc, const char *show_doc, const char *set_doc, const char *show_doc,
@ -758,16 +757,15 @@ add_setshow_optional_filename_cmd (const char *name, enum command_class theclass
struct cmd_list_element **set_list, struct cmd_list_element **set_list,
struct cmd_list_element **show_list) struct cmd_list_element **show_list)
{ {
struct cmd_list_element *set_result; set_show_commands commands
= add_setshow_cmd_full (name, theclass, var_optional_filename, var,
add_setshow_cmd_full (name, theclass, var_optional_filename, var, set_doc, show_doc, help_doc,
set_doc, show_doc, help_doc, set_func, show_func,
set_func, show_func, set_list, show_list);
set_list, show_list,
&set_result, NULL);
set_cmd_completer (set_result, filename_completer); set_cmd_completer (commands.set, filename_completer);
return commands;
} }
/* Completes on literal "unlimited". Used by integer commands that /* Completes on literal "unlimited". Used by integer commands that
@ -792,7 +790,8 @@ integer_unlimited_completer (struct cmd_list_element *ignore,
add_cmd. VAR is address of the variable which will contain the add_cmd. VAR is address of the variable which will contain the
value. SET_DOC and SHOW_DOC are the documentation strings. This value. SET_DOC and SHOW_DOC are the documentation strings. This
function is only used in Python API. Please don't use it elsewhere. */ function is only used in Python API. Please don't use it elsewhere. */
void
set_show_commands
add_setshow_integer_cmd (const char *name, enum command_class theclass, add_setshow_integer_cmd (const char *name, enum command_class theclass,
int *var, int *var,
const char *set_doc, const char *show_doc, const char *set_doc, const char *show_doc,
@ -802,22 +801,23 @@ add_setshow_integer_cmd (const char *name, enum command_class theclass,
struct cmd_list_element **set_list, struct cmd_list_element **set_list,
struct cmd_list_element **show_list) struct cmd_list_element **show_list)
{ {
struct cmd_list_element *set; set_show_commands commands
= add_setshow_cmd_full (name, theclass, var_integer, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list);
add_setshow_cmd_full (name, theclass, var_integer, var, set_cmd_completer (commands.set, integer_unlimited_completer);
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list,
&set, NULL);
set_cmd_completer (set, integer_unlimited_completer); return commands;
} }
/* Add element named NAME to both the set and show command LISTs (the /* Add element named NAME to both the set and show command LISTs (the
list for set/show or some sublist thereof). CLASS is as in list for set/show or some sublist thereof). CLASS is as in
add_cmd. VAR is address of the variable which will contain the add_cmd. VAR is address of the variable which will contain the
value. SET_DOC and SHOW_DOC are the documentation strings. */ value. SET_DOC and SHOW_DOC are the documentation strings. */
void
set_show_commands
add_setshow_uinteger_cmd (const char *name, enum command_class theclass, add_setshow_uinteger_cmd (const char *name, enum command_class theclass,
unsigned int *var, unsigned int *var,
const char *set_doc, const char *show_doc, const char *set_doc, const char *show_doc,
@ -827,22 +827,23 @@ add_setshow_uinteger_cmd (const char *name, enum command_class theclass,
struct cmd_list_element **set_list, struct cmd_list_element **set_list,
struct cmd_list_element **show_list) struct cmd_list_element **show_list)
{ {
struct cmd_list_element *set; set_show_commands commands
= add_setshow_cmd_full (name, theclass, var_uinteger, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list);
add_setshow_cmd_full (name, theclass, var_uinteger, var, set_cmd_completer (commands.set, integer_unlimited_completer);
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list,
&set, NULL);
set_cmd_completer (set, integer_unlimited_completer); return commands;
} }
/* Add element named NAME to both the set and show command LISTs (the /* Add element named NAME to both the set and show command LISTs (the
list for set/show or some sublist thereof). CLASS is as in list for set/show or some sublist thereof). CLASS is as in
add_cmd. VAR is address of the variable which will contain the add_cmd. VAR is address of the variable which will contain the
value. SET_DOC and SHOW_DOC are the documentation strings. */ value. SET_DOC and SHOW_DOC are the documentation strings. */
void
set_show_commands
add_setshow_zinteger_cmd (const char *name, enum command_class theclass, add_setshow_zinteger_cmd (const char *name, enum command_class theclass,
int *var, int *var,
const char *set_doc, const char *show_doc, const char *set_doc, const char *show_doc,
@ -852,14 +853,13 @@ add_setshow_zinteger_cmd (const char *name, enum command_class theclass,
struct cmd_list_element **set_list, struct cmd_list_element **set_list,
struct cmd_list_element **show_list) struct cmd_list_element **show_list)
{ {
add_setshow_cmd_full (name, theclass, var_zinteger, var, return add_setshow_cmd_full (name, theclass, var_zinteger, var,
set_doc, show_doc, help_doc, set_doc, show_doc, help_doc,
set_func, show_func, set_func, show_func,
set_list, show_list, set_list, show_list);
NULL, NULL);
} }
void set_show_commands
add_setshow_zuinteger_unlimited_cmd (const char *name, add_setshow_zuinteger_unlimited_cmd (const char *name,
enum command_class theclass, enum command_class theclass,
int *var, int *var,
@ -871,22 +871,23 @@ add_setshow_zuinteger_unlimited_cmd (const char *name,
struct cmd_list_element **set_list, struct cmd_list_element **set_list,
struct cmd_list_element **show_list) struct cmd_list_element **show_list)
{ {
struct cmd_list_element *set; set_show_commands commands
= add_setshow_cmd_full (name, theclass, var_zuinteger_unlimited, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list);
add_setshow_cmd_full (name, theclass, var_zuinteger_unlimited, var, set_cmd_completer (commands.set, integer_unlimited_completer);
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list,
&set, NULL);
set_cmd_completer (set, integer_unlimited_completer); return commands;
} }
/* Add element named NAME to both the set and show command LISTs (the /* Add element named NAME to both the set and show command LISTs (the
list for set/show or some sublist thereof). CLASS is as in list for set/show or some sublist thereof). CLASS is as in
add_cmd. VAR is address of the variable which will contain the add_cmd. VAR is address of the variable which will contain the
value. SET_DOC and SHOW_DOC are the documentation strings. */ value. SET_DOC and SHOW_DOC are the documentation strings. */
void
set_show_commands
add_setshow_zuinteger_cmd (const char *name, enum command_class theclass, add_setshow_zuinteger_cmd (const char *name, enum command_class theclass,
unsigned int *var, unsigned int *var,
const char *set_doc, const char *show_doc, const char *set_doc, const char *show_doc,
@ -896,11 +897,10 @@ add_setshow_zuinteger_cmd (const char *name, enum command_class theclass,
struct cmd_list_element **set_list, struct cmd_list_element **set_list,
struct cmd_list_element **show_list) struct cmd_list_element **show_list)
{ {
add_setshow_cmd_full (name, theclass, var_zuinteger, var, return add_setshow_cmd_full (name, theclass, var_zuinteger, var,
set_doc, show_doc, help_doc, set_doc, show_doc, help_doc,
set_func, show_func, set_func, show_func,
set_list, show_list, set_list, show_list);
NULL, NULL);
} }
/* Remove the command named NAME from the command list. Return the /* Remove the command named NAME from the command list. Return the

View File

@ -398,141 +398,85 @@ typedef void (show_value_ftype) (struct ui_file *file,
instead print the value out directly. */ instead print the value out directly. */
extern show_value_ftype deprecated_show_value_hack; extern show_value_ftype deprecated_show_value_hack;
extern void add_setshow_enum_cmd (const char *name, /* Return value type for the add_setshow_* functions. */
enum command_class theclass,
const char *const *enumlist,
const char **var,
const char *set_doc,
const char *show_doc,
const char *help_doc,
cmd_const_sfunc_ftype *set_func,
show_value_ftype *show_func,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list,
void *context = nullptr);
extern void add_setshow_auto_boolean_cmd (const char *name, struct set_show_commands
enum command_class theclass, {
enum auto_boolean *var, cmd_list_element *set, *show;
const char *set_doc, };
const char *show_doc,
const char *help_doc,
cmd_const_sfunc_ftype *set_func,
show_value_ftype *show_func,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list);
extern cmd_list_element * extern set_show_commands add_setshow_enum_cmd
add_setshow_boolean_cmd (const char *name, (const char *name, command_class theclass, const char *const *enumlist,
enum command_class theclass, const char **var, const char *set_doc, const char *show_doc,
bool *var, const char *help_doc, cmd_const_sfunc_ftype *set_func,
const char *set_doc, const char *show_doc, show_value_ftype *show_func, cmd_list_element **set_list,
const char *help_doc, cmd_list_element **show_list, void *context = nullptr);
cmd_const_sfunc_ftype *set_func,
show_value_ftype *show_func,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list);
extern void add_setshow_filename_cmd (const char *name, extern set_show_commands add_setshow_auto_boolean_cmd
enum command_class theclass, (const char *name, command_class theclass, auto_boolean *var,
char **var, const char *set_doc, const char *show_doc, const char *help_doc,
const char *set_doc, cmd_const_sfunc_ftype *set_func, show_value_ftype *show_func,
const char *show_doc, cmd_list_element **set_list, cmd_list_element **show_list);
const char *help_doc,
cmd_const_sfunc_ftype *set_func,
show_value_ftype *show_func,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list);
extern void add_setshow_string_cmd (const char *name, extern set_show_commands add_setshow_boolean_cmd
enum command_class theclass, (const char *name, command_class theclass, bool *var, const char *set_doc,
char **var, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func,
const char *set_doc, show_value_ftype *show_func, cmd_list_element **set_list,
const char *show_doc, cmd_list_element **show_list);
const char *help_doc,
cmd_const_sfunc_ftype *set_func,
show_value_ftype *show_func,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list);
extern struct cmd_list_element *add_setshow_string_noescape_cmd extern set_show_commands add_setshow_filename_cmd
(const char *name, (const char *name, command_class theclass, char **var, const char *set_doc,
enum command_class theclass, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func,
char **var, show_value_ftype *show_func, cmd_list_element **set_list,
const char *set_doc, cmd_list_element **show_list);
const char *show_doc,
const char *help_doc,
cmd_const_sfunc_ftype *set_func,
show_value_ftype *show_func,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list);
extern void add_setshow_optional_filename_cmd (const char *name, extern set_show_commands add_setshow_string_cmd
enum command_class theclass, (const char *name, command_class theclass, char **var, const char *set_doc,
char **var, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func,
const char *set_doc, show_value_ftype *show_func, cmd_list_element **set_list,
const char *show_doc, cmd_list_element **show_list);
const char *help_doc,
cmd_const_sfunc_ftype *set_func,
show_value_ftype *show_func,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list);
extern void add_setshow_integer_cmd (const char *name, extern set_show_commands add_setshow_string_noescape_cmd
enum command_class theclass, (const char *name, command_class theclass, char **var, const char *set_doc,
int *var, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func,
const char *set_doc, show_value_ftype *show_func, cmd_list_element **set_list,
const char *show_doc, cmd_list_element **show_list);
const char *help_doc,
cmd_const_sfunc_ftype *set_func,
show_value_ftype *show_func,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list);
extern void add_setshow_uinteger_cmd (const char *name, extern set_show_commands add_setshow_optional_filename_cmd
enum command_class theclass, (const char *name, command_class theclass, char **var, const char *set_doc,
unsigned int *var, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func,
const char *set_doc, show_value_ftype *show_func, cmd_list_element **set_list,
const char *show_doc, cmd_list_element **show_list);
const char *help_doc,
cmd_const_sfunc_ftype *set_func,
show_value_ftype *show_func,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list);
extern void add_setshow_zinteger_cmd (const char *name, extern set_show_commands add_setshow_integer_cmd
enum command_class theclass, (const char *name, command_class theclass, int *var, const char *set_doc,
int *var, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func,
const char *set_doc, show_value_ftype *show_func, cmd_list_element **set_list,
const char *show_doc, cmd_list_element **show_list);
const char *help_doc,
cmd_const_sfunc_ftype *set_func,
show_value_ftype *show_func,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list);
extern void add_setshow_zuinteger_cmd (const char *name, extern set_show_commands add_setshow_uinteger_cmd
enum command_class theclass, (const char *name, command_class theclass, unsigned int *var,
unsigned int *var, const char *set_doc, const char *show_doc, const char *help_doc,
const char *set_doc, cmd_const_sfunc_ftype *set_func, show_value_ftype *show_func,
const char *show_doc, cmd_list_element **set_list, cmd_list_element **show_list);
const char *help_doc,
cmd_const_sfunc_ftype *set_func,
show_value_ftype *show_func,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list);
extern void extern set_show_commands add_setshow_zinteger_cmd
add_setshow_zuinteger_unlimited_cmd (const char *name, (const char *name, command_class theclass, int *var, const char *set_doc,
enum command_class theclass, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func,
int *var, show_value_ftype *show_func, cmd_list_element **set_list,
const char *set_doc, cmd_list_element **show_list);
const char *show_doc,
const char *help_doc, extern set_show_commands add_setshow_zuinteger_cmd
cmd_const_sfunc_ftype *set_func, (const char *name, command_class theclass, unsigned int *var,
show_value_ftype *show_func, const char *set_doc, const char *show_doc, const char *help_doc,
struct cmd_list_element **set_list, cmd_const_sfunc_ftype *set_func, show_value_ftype *show_func,
struct cmd_list_element **show_list); cmd_list_element **set_list, cmd_list_element **show_list);
extern set_show_commands add_setshow_zuinteger_unlimited_cmd
(const char *name, command_class theclass, int *var, const char *set_doc,
const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func,
show_value_ftype *show_func, cmd_list_element **set_list,
cmd_list_element **show_list);
/* Do a "show" command for each thing on a command list. */ /* Do a "show" command for each thing on a command list. */

View File

@ -458,17 +458,17 @@ void _initialize_core ();
void void
_initialize_core () _initialize_core ()
{ {
struct cmd_list_element *c; cmd_list_element *core_file_cmd
= add_cmd ("core-file", class_files, core_file_command, _("\
c = add_cmd ("core-file", class_files, core_file_command, _("\
Use FILE as core dump for examining memory and registers.\n\ Use FILE as core dump for examining memory and registers.\n\
Usage: core-file FILE\n\ Usage: core-file FILE\n\
No arg means have no core file. This command has been superseded by the\n\ No arg means have no core file. This command has been superseded by the\n\
`target core' and `detach' commands."), &cmdlist); `target core' and `detach' commands."), &cmdlist);
set_cmd_completer (c, filename_completer); set_cmd_completer (core_file_cmd, filename_completer);
c = add_setshow_string_noescape_cmd ("gnutarget", class_files, set_show_commands set_show_gnutarget
= add_setshow_string_noescape_cmd ("gnutarget", class_files,
&gnutarget_string, _("\ &gnutarget_string, _("\
Set the current BFD target."), _("\ Set the current BFD target."), _("\
Show the current BFD target."), _("\ Show the current BFD target."), _("\
@ -476,7 +476,7 @@ Use `set gnutarget auto' to specify automatic detection."),
set_gnutarget_command, set_gnutarget_command,
show_gnutarget_string, show_gnutarget_string,
&setlist, &showlist); &setlist, &showlist);
set_cmd_completer (c, complete_set_gnutarget); set_cmd_completer (set_show_gnutarget.set, complete_set_gnutarget);
add_alias_cmd ("g", "gnutarget", class_files, 1, &setlist); add_alias_cmd ("g", "gnutarget", class_files, 1, &setlist);

View File

@ -1139,11 +1139,10 @@ void _initialize_disasm ();
void void
_initialize_disasm () _initialize_disasm ()
{ {
struct cmd_list_element *cmd;
/* Add the command that controls the disassembler options. */ /* Add the command that controls the disassembler options. */
cmd = add_setshow_string_noescape_cmd ("disassembler-options", no_class, set_show_commands set_show_disas_opts
&prospective_options, _("\ = add_setshow_string_noescape_cmd ("disassembler-options", no_class,
&prospective_options, _("\
Set the disassembler options.\n\ Set the disassembler options.\n\
Usage: set disassembler-options OPTION [,OPTION]...\n\n\ Usage: set disassembler-options OPTION [,OPTION]...\n\n\
See: 'show disassembler-options' for valid option values."), _("\ See: 'show disassembler-options' for valid option values."), _("\
@ -1151,5 +1150,5 @@ Show the disassembler options."), NULL,
set_disassembler_options_sfunc, set_disassembler_options_sfunc,
show_disassembler_options_sfunc, show_disassembler_options_sfunc,
&setlist, &showlist); &setlist, &showlist);
set_cmd_completer (cmd, disassembler_options_completer); set_cmd_completer (set_show_disas_opts.set, disassembler_options_completer);
} }

View File

@ -3572,17 +3572,18 @@ Usage: func NAME"));
/* Install "set print raw frame-arguments", a deprecated spelling of /* Install "set print raw frame-arguments", a deprecated spelling of
"set print raw-frame-arguments". */ "set print raw-frame-arguments". */
cmd = add_setshow_boolean_cmd set_show_commands set_show_frame_args
("frame-arguments", no_class, = add_setshow_boolean_cmd
&user_frame_print_options.print_raw_frame_arguments, ("frame-arguments", no_class,
_("\ &user_frame_print_options.print_raw_frame_arguments,
_("\
Set whether to print frame arguments in raw form."), _("\ Set whether to print frame arguments in raw form."), _("\
Show whether to print frame arguments in raw form."), _("\ Show whether to print frame arguments in raw form."), _("\
If set, frame arguments are printed in raw form, bypassing any\n\ If set, frame arguments are printed in raw form, bypassing any\n\
pretty-printers for that value."), pretty-printers for that value."),
NULL, NULL, NULL, NULL,
&setprintrawlist, &showprintrawlist); &setprintrawlist, &showprintrawlist);
deprecate_cmd (cmd, "set print raw-frame-arguments"); deprecate_cmd (set_show_frame_args.set, "set print raw-frame-arguments");
add_setshow_auto_boolean_cmd ("disassemble-next-line", class_stack, add_setshow_auto_boolean_cmd ("disassemble-next-line", class_stack,
&disassemble_next_line, _("\ &disassemble_next_line, _("\

View File

@ -2345,7 +2345,7 @@ input settings."),
show_interactive_mode, show_interactive_mode,
&setlist, &showlist); &setlist, &showlist);
c = add_setshow_boolean_cmd ("startup-quietly", class_support, add_setshow_boolean_cmd ("startup-quietly", class_support,
&startup_quiet, _("\ &startup_quiet, _("\
Set whether GDB should start up quietly."), _(" \ Set whether GDB should start up quietly."), _(" \
Show whether GDB should start up quietly."), _("\ Show whether GDB should start up quietly."), _("\