Merge revisions 14366 and 14367 from the BUF_REMOVAL branch to trunk.
In function dump_state_togdb use VG_(gdb_printf) directly. No need to write
to a buffer first.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14700 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/callgrind/main.c b/callgrind/main.c
index 0c54d88..be43fe6 100644
--- a/callgrind/main.c
+++ b/callgrind/main.c
@@ -1525,9 +1525,8 @@
 /* Dump current state */
 static void dump_state_togdb(void)
 {
-    static HChar buf[512];
     thread_info** th;
-    int t, p;
+    int t;
     Int orig_tid = CLG_(current_tid);
 
     VG_(gdb_printf)("instrumentation: %s\n",
@@ -1550,12 +1549,12 @@
 		
     /* threads */
     th = CLG_(get_threads)();
-    p = VG_(sprintf)(buf, "threads:");
+    VG_(gdb_printf)("threads:");
     for(t=1;t<VG_N_THREADS;t++) {
 	if (!th[t]) continue;
-	p += VG_(sprintf)(buf+p, " %d", t);
+	VG_(gdb_printf)(" %d", t);
     }
-    VG_(gdb_printf)("%s\n", buf);
+    VG_(gdb_printf)("\n");
     VG_(gdb_printf)("current-tid: %d\n", orig_tid);
     CLG_(forall_threads)(dump_state_of_thread_togdb);
 }