From a40a111fc795c4c711a2c9d846efcb14145f642f Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Thu, 7 Jul 2011 08:38:37 +0000 Subject: [PATCH] http://sourceware.org/ml/gdb-patches/2011-07/msg00085.html * cli/cli-setshow.c (do_setshow_command): Display var_zinteger variables as signed, not unsigned. --- gdb/ChangeLog | 5 +++++ gdb/cli/cli-setshow.c | 21 +++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a01bf0a1e89..f3ba9c71e25 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2011-07-07 Andrew Burgess + + * cli/cli-setshow.c (do_setshow_command): Display var_zinteger + variables as signed, not unsigned. + 2011-07-06 Joel Brobecker * jit.c (jit_inferior_init): Reformat forward declaration. diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c index 6acdd9156c6..8dbfaadde62 100644 --- a/gdb/cli/cli-setshow.c +++ b/gdb/cli/cli-setshow.c @@ -358,21 +358,18 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c) } break; case var_uinteger: - if (*(unsigned int *) c->var == UINT_MAX) - { - fputs_filtered ("unlimited", stb->stream); - break; - } - /* else fall through */ case var_zuinteger: - case var_zinteger: - fprintf_filtered (stb->stream, "%u", *(unsigned int *) c->var); + if (c->var_type == var_uinteger + && *(unsigned int *) c->var == UINT_MAX) + fputs_filtered ("unlimited", stb->stream); + else + fprintf_filtered (stb->stream, "%u", *(unsigned int *) c->var); break; case var_integer: - if (*(int *) c->var == INT_MAX) - { - fputs_filtered ("unlimited", stb->stream); - } + case var_zinteger: + if (c->var_type == var_integer + && *(int *) c->var == INT_MAX) + fputs_filtered ("unlimited", stb->stream); else fprintf_filtered (stb->stream, "%d", *(int *) c->var); break; -- 2.30.2