You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
(14) |
2
(16) |
3
(7) |
|
4
(7) |
5
(9) |
6
(8) |
7
(10) |
8
(16) |
9
(15) |
10
(9) |
|
11
(11) |
12
(13) |
13
(8) |
14
(8) |
15
(10) |
16
(25) |
17
(7) |
|
18
(7) |
19
(13) |
20
(10) |
21
(14) |
22
(11) |
23
(12) |
24
(8) |
|
25
(19) |
26
(10) |
27
(16) |
28
(13) |
|
|
|
|
From: Julian S. <js...@ac...> - 2007-02-26 10:26:43
|
> Thanks, this information allowed me to eliminate the false positives. > > By the way, is the first argument passed to unsafeIRDirty_0_N() the > number of register parameters ? This number needs to be 'n' if the function you intend to call is declared with __attribute__((regparm(n))), which is usually wrapped up into the macro VG_REGPARM(n). See eg mc_new_mem_stack_4. If that info is not in the IR, vex cannot generate the correct call sequence on x86. On all other platforms it is ignored. J |
|
From: <js...@ac...> - 2007-02-26 10:02:15
|
Nightly build on minnie ( SuSE 10.0, ppc32 ) started at 2007-02-26 09:00:01 GMT Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 219 tests, 10 stderr failures, 6 stdout failures, 0 posttest failures == memcheck/tests/leak-tree (stderr) memcheck/tests/leakotron (stdout) memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_changes (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_cmsg (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/ppc32/jm-fp (stdout) none/tests/ppc32/jm-fp (stderr) none/tests/ppc32/round (stdout) none/tests/ppc32/round (stderr) none/tests/ppc32/test_fx (stdout) none/tests/ppc32/test_fx (stderr) none/tests/ppc32/test_gx (stdout) |
|
From: Bart V. A. <bar...@gm...> - 2007-02-26 09:25:03
|
On 2/25/07, Nicholas Nethercote <nj...@cs...> wrote:
> On Sun, 25 Feb 2007, Julian Seward wrote:
>
> >> track_new_mem_stack before the client accesses stack data. Did I
> >> misunderstand something ?
> >
> > Yes (it may not be documented anywhere :-) If the core calls
> > track_new_mem_stack(x) then the new limit below which the client
> > may not go is x - VG_STACK_REDZONE_SZB. Probably you didn't see
> > this on x86 because VG_STACK_REDZONE_SZB on that platform.
> > Have a look at mc_new_mem_stack_4 et al in mc_main.c.
>
> See also the stuff about "AbiHint" in VEX/pub/libvex_ir.h and
> memcheck/mc_translate.c, and the function helperc_MAKE_STACK_UNINIT in
> mc_main.c.
Thanks, this information allowed me to eliminate the false positives.
By the way, is the first argument passed to unsafeIRDirty_0_N() the
number of register parameters ? If so, why is the first argument of
unsafeIRDirty_0_N() in do_AbiHint (memcheck/mc_translate.c) zero
instead of two ?
>From memcheck/mc_translate.c:
static
void do_AbiHint ( MCEnv* mce, IRExpr* base, Int len )
{
IRDirty* di;
di = unsafeIRDirty_0_N(
0/*regparms*/,
"MC_(helperc_MAKE_STACK_UNINIT)",
VG_(fnptr_to_fnentry)( &MC_(helperc_MAKE_STACK_UNINIT) ),
mkIRExprVec_2( base, mkIRExpr_HWord( (UInt)len) )
);
stmt( mce->bb, IRStmt_Dirty(di) );
}
Regards,
Bart.
|
|
From: <js...@ac...> - 2007-02-26 05:31:37
|
Nightly build on phoenix ( SuSE 10.0 ) started at 2007-02-26 04:55:01 GMT Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 254 tests, 6 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/leak-tree (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: Tom H. <th...@cy...> - 2007-02-26 03:25:55
|
Nightly build on dellow ( x86_64, Fedora Core 6 ) started at 2007-02-26 03:10:11 GMT Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 288 tests, 4 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: Tom H. <th...@cy...> - 2007-02-26 03:22:59
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2007-02-26 03:15:01 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Last 20 lines of verbose log follow echo /tmp/ccSNfA37.s:4393: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccSNfA37.s:4513: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccSNfA37.s:4633: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccSNfA37.s:4753: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccSNfA37.s:4873: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccSNfA37.s:4993: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccSNfA37.s:5113: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccSNfA37.s:5233: Error: no such instruction: `fisttpq -56(%ebp)' make[5]: *** [insn_sse3.o] Error 1 rm insn_mmx.c insn_sse2.c insn_fpu.c insn_mmxext.c insn_sse.c insn_sse3.c insn_cmov.c insn_basic.c make[5]: Leaving directory `/tmp/valgrind.15122/valgrind/none/tests/x86' make[4]: *** [check-am] Error 2 make[4]: Leaving directory `/tmp/valgrind.15122/valgrind/none/tests/x86' make[3]: *** [check-recursive] Error 1 make[3]: Leaving directory `/tmp/valgrind.15122/valgrind/none/tests' make[2]: *** [check-recursive] Error 1 make[2]: Leaving directory `/tmp/valgrind.15122/valgrind/none' make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory `/tmp/valgrind.15122/valgrind' make: *** [check] Error 2 ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Last 20 lines of verbose log follow echo /tmp/cc17wq8h.s:4393: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cc17wq8h.s:4513: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cc17wq8h.s:4633: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cc17wq8h.s:4753: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cc17wq8h.s:4873: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cc17wq8h.s:4993: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cc17wq8h.s:5113: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cc17wq8h.s:5233: Error: no such instruction: `fisttpq -56(%ebp)' make[5]: *** [insn_sse3.o] Error 1 rm insn_mmx.c insn_sse2.c insn_fpu.c insn_mmxext.c insn_sse.c insn_sse3.c insn_cmov.c insn_basic.c make[5]: Leaving directory `/tmp/valgrind.15122/valgrind/none/tests/x86' make[4]: *** [check-am] Error 2 make[4]: Leaving directory `/tmp/valgrind.15122/valgrind/none/tests/x86' make[3]: *** [check-recursive] Error 1 make[3]: Leaving directory `/tmp/valgrind.15122/valgrind/none/tests' make[2]: *** [check-recursive] Error 1 make[2]: Leaving directory `/tmp/valgrind.15122/valgrind/none' make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory `/tmp/valgrind.15122/valgrind' make: *** [check] Error 2 ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Mon Feb 26 03:18:47 2007 --- new.short Mon Feb 26 03:22:33 2007 *************** *** 7,16 **** Last 20 lines of verbose log follow echo ! /tmp/cc17wq8h.s:4393: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cc17wq8h.s:4513: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cc17wq8h.s:4633: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cc17wq8h.s:4753: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cc17wq8h.s:4873: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cc17wq8h.s:4993: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cc17wq8h.s:5113: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cc17wq8h.s:5233: Error: no such instruction: `fisttpq -56(%ebp)' make[5]: *** [insn_sse3.o] Error 1 --- 7,16 ---- Last 20 lines of verbose log follow echo ! /tmp/ccSNfA37.s:4393: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccSNfA37.s:4513: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccSNfA37.s:4633: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccSNfA37.s:4753: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccSNfA37.s:4873: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccSNfA37.s:4993: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccSNfA37.s:5113: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccSNfA37.s:5233: Error: no such instruction: `fisttpq -56(%ebp)' make[5]: *** [insn_sse3.o] Error 1 |
|
From: Tom H. <th...@cy...> - 2007-02-26 03:19:26
|
Nightly build on lloyd ( x86_64, Fedora Core 3 ) started at 2007-02-26 03:05:09 GMT Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 288 tests, 6 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: Tom H. <th...@cy...> - 2007-02-26 03:15:47
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2007-02-26 03:00:07 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 290 tests, 6 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) none/tests/fdleak_fcntl (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/tls (stdout) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 290 tests, 6 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) none/tests/fdleak_fcntl (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Mon Feb 26 03:06:50 2007 --- new.short Mon Feb 26 03:15:34 2007 *************** *** 8,10 **** ! == 290 tests, 6 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/pointer-trace (stderr) --- 8,10 ---- ! == 290 tests, 6 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) *************** *** 16,17 **** --- 16,18 ---- none/tests/mremap2 (stdout) + none/tests/tls (stdout) |
|
From: <js...@ac...> - 2007-02-26 01:17:01
|
Nightly build on g5 ( SuSE 10.1, ppc970 ) started at 2007-02-26 02:00:01 CET Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 225 tests, 6 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/deep_templates (stdout) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/pointer-trace (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_cmsg (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: <sv...@va...> - 2007-02-26 00:16:19
|
Author: weidendo
Date: 2007-02-26 00:16:09 +0000 (Mon, 26 Feb 2007)
New Revision: 6618
Log:
Callgrind: Fix potential buffer overruns with user provided strings
This introduces some macros to shorten the code for output of
strings to a file descriptor. I could use this a lot,
but this commit limits itself to the potential buffer overruns
(to ease backporting - provided we want to do this)
Heavy use of the macros probably blows up the code. Perhaps
it would be better to provide e.g. a VG_(write_str3) function
in the tool API.
Modified:
trunk/callgrind/command.c
trunk/callgrind/global.h
Modified: trunk/callgrind/command.c
===================================================================
--- trunk/callgrind/command.c 2007-02-25 17:13:19 UTC (rev 6617)
+++ trunk/callgrind/command.c 2007-02-26 00:16:09 UTC (rev 6618)
@@ -128,41 +128,26 @@
if (fd>=0) {
Char buf[512];
Int i;
+
+ WRITE_STR3(fd,
+ "# This file is generated by Callgrind-" VERSION ".\n"
+ "# It is used to enable controlling the supervision of\n"
+ "# '", VG_(args_the_exename), "'\n"
+ "# by external tools.\n\n");
- VG_(sprintf)(buf,
- "# This file is generated by Callgrind-" VERSION ".\n"
- "# It is used to enable controlling the supervision of\n"
- "# '%s'\n"
- "# by external tools.\n\n",
- VG_(args_the_exename)
- );
- VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
-
VG_(sprintf)(buf, "version: " COMMAND_VERSION "\n");
VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
- VG_(sprintf)(buf, "base: %s\n", dir);
- VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
-
- VG_(sprintf)(buf, "dumps: %s\n", dump_filename);
- VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
-
- VG_(sprintf)(buf, "control: %s\n", command_file);
- VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
-
- VG_(sprintf)(buf, "result: %s\n", result_file);
- VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
-
- VG_(strcpy)(buf, "cmd:");
- VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
- VG_(sprintf)(buf, " %s", VG_(args_the_exename));
- VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
+ WRITE_STR3(fd, "base: ", dir, "\n");
+ WRITE_STR3(fd, "dumps: ", dump_filename, "\n");
+ WRITE_STR3(fd, "control: ", command_file, "\n");
+ WRITE_STR3(fd, "result: ", result_file, "\n");
+
+ WRITE_STR2(fd, "cmd: ", VG_(args_the_exename));
for (i = 0; i < VG_(sizeXA)( VG_(args_for_client) ); i++) {
HChar* arg = * (HChar**)VG_(indexXA)( VG_(args_for_client), i );
if (!arg) continue;
- tl_assert( VG_(strlen)(arg) < 512-4 ); /* see [512] above */
- VG_(sprintf)(buf, " %s", arg);
- VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
+ WRITE_STR2(fd, " ", arg);
}
VG_(write)(fd, "\n", 1);
VG_(close)(fd);
@@ -224,19 +209,14 @@
VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
/* "base:" line */
- VG_(sprintf)(buf, "base: %s\n", dump_base);
- VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
+ WRITE_STR3(fd, "base: ", dump_base, "\n");
/* "cmd:" line */
- VG_(strcpy)(buf, "cmd:");
- VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
- VG_(sprintf)(buf, " %s", VG_(args_the_exename));
- VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
+ WRITE_STR2(fd, "cmd: ", VG_(args_the_exename));
for (i = 0; i < VG_(sizeXA)( VG_(args_for_client) ); i++) {
HChar* arg = * (HChar**)VG_(indexXA)( VG_(args_for_client), i );
if (!arg) continue;
- VG_(sprintf)(buf, " %s", arg);
- VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
+ WRITE_STR2(fd, " ", arg);
}
VG_(write)(fd, "\n", 1);
Modified: trunk/callgrind/global.h
===================================================================
--- trunk/callgrind/global.h 2007-02-25 17:13:19 UTC (rev 6617)
+++ trunk/callgrind/global.h 2007-02-26 00:16:09 UTC (rev 6618)
@@ -121,7 +121,44 @@
#define LINE_BUF_LEN 64
+/* Convenience macros */
+/* Use this only when size of sprintf args are known to fit into
+ * given buffer; for strings of unknown length, use WRITE_STR below
+ */
+#define WRITE_SPRINTF(fd, zz_buf, fmt, args...) \
+ do { Int len = VG_(sprintf)(zz_buf, fmt, ## args); \
+ VG_(write)(fd, (void*)zz_buf, len); \
+ } while (0)
+
+#define WRITE_STR(fd, str) \
+ do { if (str) { Int len = VG_(strlen)(str); \
+ VG_(write)(fd, (void*)str, len); } \
+ else VG_(write)(fd, "(null)", 6); \
+ } while (0)
+
+#define WRITE_STR2(fd, str1, str2) \
+ do { if (str1) { Int len = VG_(strlen)(str1); \
+ VG_(write)(fd, (void*)str1, len); } \
+ else VG_(write)(fd, "(null)", 6); \
+ if (str2) { Int len = VG_(strlen)(str2); \
+ VG_(write)(fd, (void*)str2, len); } \
+ else VG_(write)(fd, "(null)", 6); \
+ } while (0)
+
+#define WRITE_STR3(fd, str1, str2, str3) \
+ do { if (str1) { Int len = VG_(strlen)(str1); \
+ VG_(write)(fd, (void*)str1, len); } \
+ else VG_(write)(fd, "(null)", 6); \
+ if (str2) { Int len = VG_(strlen)(str2); \
+ VG_(write)(fd, (void*)str2, len); } \
+ else VG_(write)(fd, "(null)", 6); \
+ if (str3) { Int len = VG_(strlen)(str3); \
+ VG_(write)(fd, (void*)str3, len); } \
+ else VG_(write)(fd, "(null)", 6); \
+ } while (0)
+
+
/*------------------------------------------------------------*/
/*--- Statistics ---*/
/*------------------------------------------------------------*/
|