2004-07-28 Andrew Cagney <cagney@gnu.org>

* cli/cli-decode.c (add_setshow_zinteger_cmd)
	(add_setshow_cmd, add_setshow_auto_boolean_cmd)
	(add_setshow_boolean_cmd, add_setshow_cmd_full): Add help_doc and
	print parameters.  Make string parameters constant.
	* command.h: Update.  Update copyright.
	* remote.c (add_packet_config_cmd, _initialize_remote): Ditto.
	* observer.c (_initialize_observer): Ditto.
	* frame.c (_initialize_frame): Ditto.
	* complaints.c (_initialize_complaints): Ditto.
	* maint.c (_initialize_maint_cmds): Ditto.
	* target.c (initialize_targets): Ditto.
	* cli/cli-logging.c (_initialize_cli_logging): Ditto.
	* infcall.c (_initialize_infcall): Ditto.
	* arm-tdep.c (_initialize_arm_tdep): Ditto.
	* m32r-rom.c (_initialize_m32r_rom): Ditto.
	* remote-rdi.c (_initialize_remote_rdi): Ditto.
	* d10v-tdep.c (_initialize_d10v_tdep): Ditto.
	* mips-tdep.c (_initialize_mips_tdep): Ditto.
This commit is contained in:
Andrew Cagney
2004-07-28 17:26:27 +00:00
parent 54a5b07d66
commit 3b64bf9877
17 changed files with 219 additions and 163 deletions

View File

@ -1,6 +1,6 @@
/* Handle lists of commands, their decoding and documentation, for GDB.
Copyright 1986, 1989, 1990, 1991, 1998, 2000, 2001, 2002 Free
Copyright 1986, 1989, 1990, 1991, 1998, 2000, 2001, 2002, 2004 Free
Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@ -320,16 +320,19 @@ add_set_or_show_cmd (char *name,
CLASS is as in add_cmd. VAR_TYPE is the kind of thing we are
setting. VAR is address of the variable being controlled by this
command. SET_FUNC and SHOW_FUNC are the callback functions (if
non-NULL). SET_DOC and SHOW_DOC are the documentation strings.
SET_RESULT and SHOW_RESULT, if not NULL, are set to the resulting
command structures. */
non-NULL). SET_DOC, SHOW_DOC and HELP_DOC are the documentation
strings. PRINT the format string to print the value. SET_RESULT
and SHOW_RESULT, if not NULL, are set to the resulting command
structures. */
void
add_setshow_cmd_full (char *name,
enum command_class class,
var_types var_type, void *var,
char *set_doc, char *show_doc,
cmd_sfunc_ftype *set_func, cmd_sfunc_ftype *show_func,
const char *set_doc, const char *show_doc,
const char *help_doc, const char *print,
cmd_sfunc_ftype *set_func,
cmd_sfunc_ftype *show_func,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list,
struct cmd_list_element **set_result,
@ -337,12 +340,14 @@ add_setshow_cmd_full (char *name,
{
struct cmd_list_element *set;
struct cmd_list_element *show;
char *full_set_doc = xstrprintf ("%s\n%s", set_doc, help_doc);
char *full_show_doc = xstrprintf ("%s\n%s", show_doc, help_doc);
set = add_set_or_show_cmd (name, set_cmd, class, var_type, var,
set_doc, set_list);
full_set_doc, set_list);
if (set_func != NULL)
set_cmd_sfunc (set, set_func);
show = add_set_or_show_cmd (name, show_cmd, class, var_type, var,
show_doc, show_list);
full_show_doc, show_list);
if (show_func != NULL)
set_cmd_sfunc (show, show_func);
@ -362,12 +367,14 @@ void
add_setshow_cmd (char *name,
enum command_class class,
var_types var_type, void *var,
char *set_doc, char *show_doc,
const char *set_doc, const char *show_doc,
const char *help_doc, const char *print,
cmd_sfunc_ftype *set_func, cmd_sfunc_ftype *show_func,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list)
{
add_setshow_cmd_full (name, class, var_type, var, set_doc, show_doc,
add_setshow_cmd_full (name, class, var_type, var,
set_doc, show_doc, help_doc, print,
set_func, show_func, set_list, show_list,
NULL, NULL);
}
@ -414,7 +421,8 @@ void
add_setshow_auto_boolean_cmd (char *name,
enum command_class class,
enum auto_boolean *var,
char *set_doc, char *show_doc,
const char *set_doc, const char *show_doc,
const char *help_doc, const char *print,
cmd_sfunc_ftype *set_func,
cmd_sfunc_ftype *show_func,
struct cmd_list_element **set_list,
@ -423,7 +431,8 @@ add_setshow_auto_boolean_cmd (char *name,
static const char *auto_boolean_enums[] = { "on", "off", "auto", NULL };
struct cmd_list_element *c;
add_setshow_cmd_full (name, class, var_auto_boolean, var,
set_doc, show_doc, set_func, show_func,
set_doc, show_doc, help_doc, print,
set_func, show_func,
set_list, show_list,
&c, NULL);
c->enums = auto_boolean_enums;
@ -434,9 +443,9 @@ add_setshow_auto_boolean_cmd (char *name,
add_cmd. VAR is address of the variable which will contain the
value. SET_DOC and SHOW_DOC are the documentation strings. */
void
add_setshow_boolean_cmd (char *name,
enum command_class class,
int *var, char *set_doc, char *show_doc,
add_setshow_boolean_cmd (char *name, enum command_class class, int *var,
const char *set_doc, const char *show_doc,
const char *help_doc, const char *print,
cmd_sfunc_ftype *set_func,
cmd_sfunc_ftype *show_func,
struct cmd_list_element **set_list,
@ -445,7 +454,7 @@ add_setshow_boolean_cmd (char *name,
static const char *boolean_enums[] = { "on", "off", NULL };
struct cmd_list_element *c;
add_setshow_cmd_full (name, class, var_boolean, var,
set_doc, show_doc,
set_doc, show_doc, help_doc, print,
set_func, show_func,
set_list, show_list,
&c, NULL);
@ -457,16 +466,17 @@ add_setshow_boolean_cmd (char *name,
add_cmd. VAR is address of the variable which will contain the
value. SET_DOC and SHOW_DOC are the documentation strings. */
void
add_setshow_uinteger_cmd (char *name,
enum command_class class,
unsigned int *var, char *set_doc, char *show_doc,
add_setshow_uinteger_cmd (char *name, enum command_class class,
unsigned int *var,
const char *set_doc, const char *show_doc,
const char *help_doc, const char *print,
cmd_sfunc_ftype *set_func,
cmd_sfunc_ftype *show_func,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list)
{
add_setshow_cmd_full (name, class, var_uinteger, var,
set_doc, show_doc,
set_doc, show_doc, help_doc, print,
set_func, show_func,
set_list, show_list,
NULL, NULL);
@ -477,16 +487,17 @@ add_setshow_uinteger_cmd (char *name,
add_cmd. VAR is address of the variable which will contain the
value. SET_DOC and SHOW_DOC are the documentation strings. */
void
add_setshow_zinteger_cmd (char *name,
enum command_class class,
int *var, char *set_doc, char *show_doc,
add_setshow_zinteger_cmd (char *name, enum command_class class,
int *var,
const char *set_doc, const char *show_doc,
const char *help_doc, const char *print,
cmd_sfunc_ftype *set_func,
cmd_sfunc_ftype *show_func,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list)
{
add_setshow_cmd_full (name, class, var_zinteger, var,
set_doc, show_doc,
set_doc, show_doc, help_doc, print,
set_func, show_func,
set_list, show_list,
NULL, NULL);

View File

@ -1,7 +1,6 @@
/* Command-line output logging for GDB, the GNU debugger.
Copyright 2003
Free Software Foundation, Inc.
Copyright 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@ -175,26 +174,24 @@ _initialize_cli_logging (void)
add_prefix_cmd ("logging", class_support, show_logging_command,
"Show logging options", &show_logging_cmdlist,
"show logging ", 0, &showlist);
add_setshow_boolean_cmd ("overwrite", class_support, &logging_overwrite,
"Set whether logging overwrites or appends "
"to the log file.\n",
"Show whether logging overwrites or appends "
"to the log file.\n",
add_setshow_boolean_cmd ("overwrite", class_support, &logging_overwrite, "\
Set whether logging overwrites or appends to the log file.", "\
Show whether logging overwrites or appends to the log file.", "\
If set, logging overrides the log file.", "\
Whether logging overwrites or appends to the log file is %s.",
NULL, NULL, &set_logging_cmdlist, &show_logging_cmdlist);
add_setshow_boolean_cmd ("redirect", class_support, &logging_redirect,
"Set the logging output mode.\n"
"If redirect is off, output will go to both the "
"screen and the log file.\n"
"If redirect is on, output will go only to the log "
"file.",
"Show the logging output mode.\n"
"If redirect is off, output will go to both the "
"screen and the log file.\n"
"If redirect is on, output will go only to the log "
"file.",
add_setshow_boolean_cmd ("redirect", class_support, &logging_redirect, "\
Set the logging output mode.", "\
Show the logging output mode.", "\
If redirect is off, output will go to both the screen and the log file.\n\
If redirect is on, output will go only to the log file.", "\
The logging output mode is %s.",
NULL, NULL, &set_logging_cmdlist, &show_logging_cmdlist);
add_setshow_cmd ("file", class_support, var_filename, &logging_filename,
"Set the current logfile.", "Show the current logfile.",
add_setshow_cmd ("file", class_support, var_filename, &logging_filename, "\
Set the current logfile.", "\
Show the current logfile.", "\
The logfile is used when directing GDB's output.", "\
The current logfile is %s.",
NULL, NULL, &set_logging_cmdlist, &show_logging_cmdlist);
add_cmd ("on", class_support, set_logging_on,
"Enable logging.", &set_logging_cmdlist);