[PATCH] Display var_zinteger as signed

Andrew Burgess
2011-07-04T10:35:57Z

Currently the behaviour of var_zinteger variables is to print as
unsigned, so,

(gdb) set debug infrun -5
(gdb) show debug infrun
Inferior debugging is 4294967291.

With the patch it is displayed as -5.

Cheers,
Andrew

2011-07-04 Andrew Burgess <aburgess@broadcom.com>

* cli/cli-setshow.c (do_setshow_command): Display var_zinteger
variables as signed, not unsigned.

diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index 6acdd91..d35f43a 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -365,7 +365,6 @@ do_setshow_command (char *arg, int from_tty, struct
cmd_list_element *c)
}
/* else fall through */
case var_zuinteger:
- case var_zinteger:
fprintf_filtered (stb->stream, "%u", *(unsigned int *) c->var);
break;
case var_integer:
@@ -373,8 +372,9 @@ do_setshow_command (char *arg, int from_tty, struct
cmd_list_element *c)
{
fputs_filtered ("unlimited", stb->stream);
}
- else
- fprintf_filtered (stb->stream, "%d", *(int *) c->var);
+ /* else fall through */
+ case var_zinteger:
+ fprintf_filtered (stb->stream, "%d", *(int *) c->var);
break;