This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Display var_zinteger as signed
- From: "Andrew Burgess" <aburgess at broadcom dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 4 Jul 2011 11:35:23 +0100
- Subject: [PATCH] Display var_zinteger as signed
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;
default: