This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Fix --statistics output for startup.
- From: dje at google dot com (Doug Evans)
- To: gdb-patches at sourceware dot org
- Date: Sat, 5 Nov 2011 10:10:19 -0700 (PDT)
- Subject: [commit] Fix --statistics output for startup.
Hi.
This is an obvious patch to fix the output of --statistics at startup.
Committed.
2011-11-05 Doug Evans <dje@google.com>
* main.c (captured_main): Set lim_at_start before calling
make_command_stats_cleanup.
Index: main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.96
diff -u -p -r1.96 main.c
--- main.c 2 Sep 2011 16:56:29 -0000 1.96
+++ main.c 5 Nov 2011 17:06:18 -0000
@@ -300,7 +300,14 @@ captured_main (void *data)
int save_auto_load;
struct objfile *objfile;
- struct cleanup *pre_stat_chain = make_command_stats_cleanup (0);
+ struct cleanup *pre_stat_chain;
+
+#ifdef HAVE_SBRK
+ /* Set this before calling make_command_stats_cleanup. */
+ lim_at_start = (char *) sbrk (0);
+#endif
+
+ pre_stat_chain = make_command_stats_cleanup (0);
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
setlocale (LC_MESSAGES, "");
@@ -311,10 +318,6 @@ captured_main (void *data)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
-#ifdef HAVE_SBRK
- lim_at_start = (char *) sbrk (0);
-#endif
-
cmdsize = 1;
cmdarg = (struct cmdarg *) xmalloc (cmdsize * sizeof (*cmdarg));
ncmd = 0;