From: Bart Van Assche Date: Sun, 6 Apr 2008 13:03:49 +0000 (+0000) Subject: Simplified format in which a vector clock is printed. X-Git-Tag: svn/VALGRIND_3_4_0~750 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cc665696b961e8d8e21405fc5a569045adcbe146;p=thirdparty%2Fvalgrind.git Simplified format in which a vector clock is printed. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7849 --- diff --git a/exp-drd/drd_vc.c b/exp-drd/drd_vc.c index fb03d6b5d6..d4ca878fe2 100644 --- a/exp-drd/drd_vc.c +++ b/exp-drd/drd_vc.c @@ -260,15 +260,20 @@ void vc_snprint(Char* const str, Int const size, const VectorClock* const vc) { unsigned i; + unsigned j = 1; tl_assert(vc); VG_(snprintf)(str, size, "["); for (i = 0; i < vc->size; i++) { tl_assert(vc->vc); - VG_(snprintf)(str + VG_(strlen)(str), size - VG_(strlen)(str), - "%s %d: %d", i > 0 ? "," : "", - vc->vc[i].threadid, vc->vc[i].count); + for ( ; j <= vc->vc[i].threadid; j++) + { + VG_(snprintf)(str + VG_(strlen)(str), size - VG_(strlen)(str), + "%s %d", + i > 0 ? "," : "", + (j == vc->vc[i].threadid) ? vc->vc[i].count : 0); + } } VG_(snprintf)(str + VG_(strlen)(str), size - VG_(strlen)(str), " ]"); }