FYI: fix printing of negative space change
Tom Tromey
tromey@redhat.com
Fri Apr 1 17:20:00 GMT 2011
I'm checking this in.
A user noticed that the `maint space' code will improperly print two `-'
signs if gdb's space use happens to shrink.
The bug is that `%ld' will print one `-', but gdb explicitly prints
another.
Built and regtested on x86-64 (compile farm).
Tom
2011-04-01 Tom Tromey <tromey@redhat.com>
* utils.c (report_command_stats): Don't print `-' for negative
number.
diff --git a/gdb/utils.c b/gdb/utils.c
index e688d19..b1098f9 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -657,10 +657,10 @@ report_command_stats (void *arg)
long space_diff = space_now - start_stats->start_space;
printf_unfiltered (msg_type == 0
- ? _("Space used: %ld (%c%ld during startup)\n")
- : _("Space used: %ld (%c%ld for this command)\n"),
+ ? _("Space used: %ld (%s%ld during startup)\n")
+ : _("Space used: %ld (%s%ld for this command)\n"),
space_now,
- (space_diff >= 0 ? '+' : '-'),
+ (space_diff >= 0 ? "+" : ""),
space_diff);
#endif
}
More information about the Gdb-patches
mailing list