summaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2009-01-23 18:47:42 +0000
committerPedro Alves <pedro@codesourcery.com>2009-01-23 18:47:42 +0000
commitecdf4477c1cba445b81193d6609f06aebdebeba9 (patch)
tree3912ef5e4b01399e96b2faa9fd0f9e1a3c8a55f8 /gdb/cli
parent1f14283bfadf9f5d9b68b8863947c0d4fb2c3cf2 (diff)
downloadgdb-ecdf4477c1cba445b81193d6609f06aebdebeba9.tar.gz
2009-01-23 Pedro Alves <pedro@codesourcery.com>
* cli/cli-decode.c (add_setshow_zuinteger_cmd): New. * cli/cli-setshow.c (do_setshow_command): Handle it. * command.h (enum var_types): Add var_zuinteger. (add_setshow_zuinteger_cmd): Declare. * valprint.c (_initialize_valprint): Change the set input-radix and set output-radix commands to zuinteger type. 2009-01-23 Pedro Alves <pedro@codesourcery.com> * gdb.base/radix.exp: Add tests to ensure that that set input-radix 0 and set output-radix 0 are really rejected.
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-decode.c21
-rw-r--r--gdb/cli/cli-setshow.c6
2 files changed, 27 insertions, 0 deletions
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index d71d516975d..556c0278a84 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -639,6 +639,27 @@ add_setshow_zinteger_cmd (char *name, enum command_class class,
NULL, NULL);
}
+/* 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
+ 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_zuinteger_cmd (char *name, enum command_class class,
+ unsigned int *var,
+ const char *set_doc, const char *show_doc,
+ const char *help_doc,
+ cmd_sfunc_ftype *set_func,
+ show_value_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list)
+{
+ add_setshow_cmd_full (name, class, var_zuinteger, var,
+ set_doc, show_doc, help_doc,
+ set_func, show_func,
+ set_list, show_list,
+ NULL, NULL);
+}
+
/* Remove the command named NAME from the command list. Return the
list commands which were aliased to the deleted command. If the
command had no aliases, return NULL. The various *HOOKs are set to
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index be0581de85f..206a55d8f0b 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -232,6 +232,11 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
error_no_arg (_("integer to set it to."));
*(int *) c->var = parse_and_eval_long (arg);
break;
+ case var_zuinteger:
+ if (arg == NULL)
+ error_no_arg (_("integer to set it to."));
+ *(unsigned int *) c->var = parse_and_eval_long (arg);
+ break;
case var_enum:
{
int i;
@@ -351,6 +356,7 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
break;
}
/* else fall through */
+ case var_zuinteger:
case var_zinteger:
fprintf_filtered (stb->stream, "%u", *(unsigned int *) c->var);
break;