aboutsummaryrefslogtreecommitdiff
path: root/gdb/command.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-03-30 23:06:29 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-03-30 23:06:29 +0000
commit359a097f9fac5066bce1f1fc78ff99d61c1d94cc (patch)
tree162c0faf0f0ce4f4a8c3209c01c2e0a1859a1d90 /gdb/command.c
parentae35ae7f4c94c6fcbdd14a3af7e82891583122fb (diff)
downloadgdb-359a097f9fac5066bce1f1fc78ff99d61c1d94cc.zip
gdb-359a097f9fac5066bce1f1fc78ff99d61c1d94cc.tar.gz
gdb-359a097f9fac5066bce1f1fc78ff99d61c1d94cc.tar.bz2
Tue Mar 30 08:06:24 1993 Jim Kingdon (kingdon@cygnus.com)
* command.c (do_setshow_command): Use %u with var_{u,z}integer. * command.{c,h}: New var_type var_integer. main.c: Use it for history_size. * rs6000-tdep.c, xcoffexec.c, config/rs6000/xm-rs6000.h, breakpoint.c: Lint and byte-order fixups.
Diffstat (limited to 'gdb/command.c')
-rw-r--r--gdb/command.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/gdb/command.c b/gdb/command.c
index abcc1a0..092f860 100644
--- a/gdb/command.c
+++ b/gdb/command.c
@@ -1058,6 +1058,20 @@ do_setshow_command (arg, from_tty, c)
if (*(unsigned int *) c->var == 0)
*(unsigned int *) c->var = UINT_MAX;
break;
+ case var_integer:
+ {
+ unsigned int val;
+ if (arg == NULL)
+ error_no_arg ("integer to set it to.");
+ val = parse_and_eval_address (arg);
+ if (val == 0)
+ *(int *) c->var = INT_MAX;
+ else if (val >= INT_MAX)
+ error ("integer %u out of range", val);
+ else
+ *(int *) c->var = val;
+ break;
+ }
case var_zinteger:
if (arg == NULL)
error_no_arg ("integer to set it to.");
@@ -1101,8 +1115,17 @@ do_setshow_command (arg, from_tty, c)
}
/* else fall through */
case var_zinteger:
- fprintf_filtered (stdout, "%d", *(unsigned int *) c->var);
+ fprintf_filtered (stdout, "%u", *(unsigned int *) c->var);
break;
+ case var_integer:
+ if (*(int *) c->var == INT_MAX)
+ {
+ fputs_filtered ("unlimited", stdout);
+ }
+ else
+ fprintf_filtered (stdout, "%d", *(int *) c->var);
+ break;
+
default:
error ("gdb internal error: bad var_type in do_setshow_command");
}