summaryrefslogtreecommitdiff
path: root/gdb/cli/cli-setshow.c
diff options
context:
space:
mode:
authoraburgess <aburgess>2011-07-07 08:38:29 +0000
committeraburgess <aburgess>2011-07-07 08:38:29 +0000
commit4580b7b5912496cf9a3ae48b8361848fde0720cf (patch)
tree4807988ae7440bc5f274066ceb8c64468f90e008 /gdb/cli/cli-setshow.c
parent3ce54eac3a187fc67983dd408776c26743b4248a (diff)
downloadgdb-4580b7b5912496cf9a3ae48b8361848fde0720cf.tar.gz
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.
Diffstat (limited to 'gdb/cli/cli-setshow.c')
-rw-r--r--gdb/cli/cli-setshow.c21
1 files changed, 9 insertions, 12 deletions
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;