2011-02-14 Michael Snyder <msnyder@vmware.com>
* command.h (enum command_class): New class 'no_set_class', for "show" commands without a corresponding "set" command. * value.c (_initialize_values): Use 'no_set_class' for "show values". * copying.c (_initialize_copying): Ditto for "show copying" and "show warranty". * cli/cli-cmds.c (init_cli_cmds): Ditto for "show commands" and "show version". * cli/cli-setshow.c (cmd_show_list): Skip "show" commands for which there is no corresponding "set" command (eg. "show copying").
This commit is contained in:
parent
08e796bc55
commit
db5f229b95
6 changed files with 34 additions and 17 deletions
|
@ -1,3 +1,15 @@
|
||||||
|
2011-02-14 Michael Snyder <msnyder@vmware.com>
|
||||||
|
|
||||||
|
* command.h (enum command_class): New class 'no_set_class', for
|
||||||
|
"show" commands without a corresponding "set" command.
|
||||||
|
* value.c (_initialize_values): Use 'no_set_class' for "show values".
|
||||||
|
* copying.c (_initialize_copying): Ditto for "show copying" and
|
||||||
|
"show warranty".
|
||||||
|
* cli/cli-cmds.c (init_cli_cmds): Ditto for "show commands" and
|
||||||
|
"show version".
|
||||||
|
* cli/cli-setshow.c (cmd_show_list): Skip "show" commands for
|
||||||
|
which there is no corresponding "set" command (eg. "show copying").
|
||||||
|
|
||||||
2011-02-14 Pedro Alves <pedro@codesourcery.com>
|
2011-02-14 Pedro Alves <pedro@codesourcery.com>
|
||||||
Jan Kratochvil <jan.kratochvil@redhat.com>
|
Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
|
|
@ -1533,13 +1533,13 @@ Generic command for showing things about the debugger."),
|
||||||
/* Another way to get at the same thing. */
|
/* Another way to get at the same thing. */
|
||||||
add_info ("set", show_command, _("Show all GDB settings."));
|
add_info ("set", show_command, _("Show all GDB settings."));
|
||||||
|
|
||||||
add_cmd ("commands", no_class, show_commands, _("\
|
add_cmd ("commands", no_set_class, show_commands, _("\
|
||||||
Show the history of commands you typed.\n\
|
Show the history of commands you typed.\n\
|
||||||
You can supply a command number to start with, or a `+' to start after\n\
|
You can supply a command number to start with, or a `+' to start after\n\
|
||||||
the previous command number shown."),
|
the previous command number shown."),
|
||||||
&showlist);
|
&showlist);
|
||||||
|
|
||||||
add_cmd ("version", no_class, show_version,
|
add_cmd ("version", no_set_class, show_version,
|
||||||
_("Show what version of GDB this is."), &showlist);
|
_("Show what version of GDB this is."), &showlist);
|
||||||
|
|
||||||
add_com ("while", class_support, while_command, _("\
|
add_com ("while", class_support, while_command, _("\
|
||||||
|
|
|
@ -434,18 +434,21 @@ cmd_show_list (struct cmd_list_element *list, int from_tty, char *prefix)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct cleanup *option_chain
|
if (list->class != no_set_class)
|
||||||
= make_cleanup_ui_out_tuple_begin_end (uiout, "option");
|
{
|
||||||
|
struct cleanup *option_chain
|
||||||
|
= make_cleanup_ui_out_tuple_begin_end (uiout, "option");
|
||||||
|
|
||||||
ui_out_text (uiout, prefix);
|
ui_out_text (uiout, prefix);
|
||||||
ui_out_field_string (uiout, "name", list->name);
|
ui_out_field_string (uiout, "name", list->name);
|
||||||
ui_out_text (uiout, ": ");
|
ui_out_text (uiout, ": ");
|
||||||
if (list->type == show_cmd)
|
if (list->type == show_cmd)
|
||||||
do_setshow_command ((char *) NULL, from_tty, list);
|
do_setshow_command ((char *) NULL, from_tty, list);
|
||||||
else
|
else
|
||||||
cmd_func (list, NULL, from_tty);
|
cmd_func (list, NULL, from_tty);
|
||||||
/* Close the tuple. */
|
/* Close the tuple. */
|
||||||
do_cleanups (option_chain);
|
do_cleanups (option_chain);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Close the tuple. */
|
/* Close the tuple. */
|
||||||
|
|
|
@ -34,7 +34,9 @@ enum command_class
|
||||||
no_class = -1, class_run = 0, class_vars, class_stack, class_files,
|
no_class = -1, class_run = 0, class_vars, class_stack, class_files,
|
||||||
class_support, class_info, class_breakpoint, class_trace,
|
class_support, class_info, class_breakpoint, class_trace,
|
||||||
class_alias, class_bookmark, class_obscure, class_maintenance,
|
class_alias, class_bookmark, class_obscure, class_maintenance,
|
||||||
class_pseudo, class_tui, class_user, class_xdb
|
class_pseudo, class_tui, class_user, class_xdb,
|
||||||
|
no_set_class /* Used for "show" commands that have no corresponding
|
||||||
|
"set" command. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* FIXME: cagney/2002-03-17: Once cmd_type() has been removed, ``enum
|
/* FIXME: cagney/2002-03-17: Once cmd_type() has been removed, ``enum
|
||||||
|
|
|
@ -649,10 +649,10 @@ show_warranty_command (char *ignore, int from_tty)
|
||||||
void
|
void
|
||||||
_initialize_copying (void)
|
_initialize_copying (void)
|
||||||
{
|
{
|
||||||
add_cmd ("copying", no_class, show_copying_command,
|
add_cmd ("copying", no_set_class, show_copying_command,
|
||||||
_("Conditions for redistributing copies of GDB."),
|
_("Conditions for redistributing copies of GDB."),
|
||||||
&showlist);
|
&showlist);
|
||||||
add_cmd ("warranty", no_class, show_warranty_command,
|
add_cmd ("warranty", no_set_class, show_warranty_command,
|
||||||
_("Various kinds of warranty you do not have."),
|
_("Various kinds of warranty you do not have."),
|
||||||
&showlist);
|
&showlist);
|
||||||
|
|
||||||
|
|
|
@ -3074,7 +3074,7 @@ A few convenience variables are given values automatically:\n\
|
||||||
\"$__\" holds the contents of the last address examined with \"x\"."),
|
\"$__\" holds the contents of the last address examined with \"x\"."),
|
||||||
&showlist);
|
&showlist);
|
||||||
|
|
||||||
add_cmd ("values", no_class, show_values, _("\
|
add_cmd ("values", no_set_class, show_values, _("\
|
||||||
Elements of value history around item number IDX (or last ten)."),
|
Elements of value history around item number IDX (or last ten)."),
|
||||||
&showlist);
|
&showlist);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue