aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2011-02-14 23:41:33 +0000
committerMichael Snyder <msnyder@vmware.com>2011-02-14 23:41:33 +0000
commitdb5f229b95d85f40de467ebe869732cdbb18c458 (patch)
treecade0853557de249ad0dc6b61723692d5d8529f1 /gdb/cli
parent08e796bc55ca0f881c0afd1cbd76ca8aa19d0e3f (diff)
downloadgdb-db5f229b95d85f40de467ebe869732cdbb18c458.zip
gdb-db5f229b95d85f40de467ebe869732cdbb18c458.tar.gz
gdb-db5f229b95d85f40de467ebe869732cdbb18c458.tar.bz2
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").
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-cmds.c4
-rw-r--r--gdb/cli/cli-setshow.c27
2 files changed, 17 insertions, 14 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index c11b257..e3cccdf 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -1533,13 +1533,13 @@ Generic command for showing things about the debugger."),
/* Another way to get at the same thing. */
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\
You can supply a command number to start with, or a `+' to start after\n\
the previous command number shown."),
&showlist);
- add_cmd ("version", no_class, show_version,
+ add_cmd ("version", no_set_class, show_version,
_("Show what version of GDB this is."), &showlist);
add_com ("while", class_support, while_command, _("\
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index c676f3b..6acdd91 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -434,18 +434,21 @@ cmd_show_list (struct cmd_list_element *list, int from_tty, char *prefix)
}
else
{
- struct cleanup *option_chain
- = make_cleanup_ui_out_tuple_begin_end (uiout, "option");
-
- ui_out_text (uiout, prefix);
- ui_out_field_string (uiout, "name", list->name);
- ui_out_text (uiout, ": ");
- if (list->type == show_cmd)
- do_setshow_command ((char *) NULL, from_tty, list);
- else
- cmd_func (list, NULL, from_tty);
- /* Close the tuple. */
- do_cleanups (option_chain);
+ if (list->class != no_set_class)
+ {
+ struct cleanup *option_chain
+ = make_cleanup_ui_out_tuple_begin_end (uiout, "option");
+
+ ui_out_text (uiout, prefix);
+ ui_out_field_string (uiout, "name", list->name);
+ ui_out_text (uiout, ": ");
+ if (list->type == show_cmd)
+ do_setshow_command ((char *) NULL, from_tty, list);
+ else
+ cmd_func (list, NULL, from_tty);
+ /* Close the tuple. */
+ do_cleanups (option_chain);
+ }
}
}
/* Close the tuple. */