aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2012-07-24 12:49:22 +0000
committerYao Qi <yao@codesourcery.com>2012-07-24 12:49:22 +0000
commite2d12c215218cb525eda808e0875f07102e36fce (patch)
treea61b62b6a9c396954ca256d76dd54a8ac019940f /gdb/cli
parent3c6d336c317c0fa9dc7911f5c3e1390138f610bf (diff)
downloadbinutils-e2d12c215218cb525eda808e0875f07102e36fce.zip
binutils-e2d12c215218cb525eda808e0875f07102e36fce.tar.gz
binutils-e2d12c215218cb525eda808e0875f07102e36fce.tar.bz2
gdb/
* cli/cli-setshow.c (do_setshow_command): Handle case 'var_uinteger' and 'var_zuninteger' together. Handle case 'var_integer' and 'var_zinteger' together.
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-setshow.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index 5ec7b55..7ffb89e 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -208,20 +208,22 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
*(enum auto_boolean *) c->var = parse_auto_binary_operation (arg);
break;
case var_uinteger:
+ case var_zuinteger:
if (arg == NULL)
error_no_arg (_("integer to set it to."));
*(unsigned int *) c->var = parse_and_eval_long (arg);
- if (*(unsigned int *) c->var == 0)
+ if (c->var_type == var_uinteger && *(unsigned int *) c->var == 0)
*(unsigned int *) c->var = UINT_MAX;
break;
case var_integer:
+ case var_zinteger:
{
unsigned int val;
if (arg == NULL)
error_no_arg (_("integer to set it to."));
val = parse_and_eval_long (arg);
- if (val == 0)
+ if (val == 0 && c->var_type == var_integer)
*(int *) c->var = INT_MAX;
else if (val >= INT_MAX)
error (_("integer %u out of range"), val);
@@ -229,16 +231,6 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
*(int *) c->var = val;
break;
}
- case var_zinteger:
- if (arg == NULL)
- 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;