summaryrefslogtreecommitdiff
path: root/gdb/cli/cli-setshow.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2011-02-14 23:41:33 +0000
committerMichael Snyder <msnyder@specifix.com>2011-02-14 23:41:33 +0000
commit1a163d2b16a3192e4724a4f6270fe5a2d58d1465 (patch)
tree1f466828e1a172fcc32c7c64ecce6c4ef21ea07d /gdb/cli/cli-setshow.c
parentaa4ca091d8e015ba58ad951d0df13d2127e7c633 (diff)
downloadgdb-1a163d2b16a3192e4724a4f6270fe5a2d58d1465.tar.gz
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/cli-setshow.c')
-rw-r--r--gdb/cli/cli-setshow.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index c676f3bf3bc..6acdd9156c6 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. */