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
(36) |
2
(30) |
|
3
(17) |
4
(21) |
5
(18) |
6
(14) |
7
(23) |
8
(12) |
9
(11) |
|
10
(11) |
11
(12) |
12
(11) |
13
(12) |
14
(11) |
15
(11) |
16
(15) |
|
17
(12) |
18
(15) |
19
(15) |
20
(25) |
21
(26) |
22
(21) |
23
(18) |
|
24
(25) |
25
(28) |
26
(27) |
27
(32) |
28
(13) |
29
(12) |
30
(10) |
|
From: Josef W. <Jos...@gm...> - 2005-04-25 16:00:07
|
On Monday 25 April 2005 17:08, Benoit Peccatte wrote: > Le ven 22/04/2005 =C3=A0 18:52, Josef Weidendorfer a =C3=A9crit : > > Ah, good. I didn't know you can iterate over debug info in a Valgrind > > tool. > > Well, I didn't use directly valgrind functions. I copied needed > structures from vg_symtab.h into the tool's header. I know that's not > perfectly clean, but it works for now. It would be good to have some iterator functions for debug info available f= or=20 tools. Structs are bad wrt. interface stability. > > header like > > event: Coverage =3D Executed / DebugInfo > > and will calculate everything itself. But note that currently there is = no > > support for parsing "/" in formulas. > > Ok, I understand now. Yes I would need the '/' then, but I can't see > where the '+' is parsed. =46ormulas for derived events are only possible in KCachegrind for the mome= nt.=20 Interpreting formulas should be not to difficult to add in a PERL script li= ke=20 cg_annotate (via "eval"). I'll try. > As the format is extensible, I'd like to keep a new information > associated with each file name : the soname where it has been found. > Can I add a so=3D... before fl=3D... ? Do you mean the file name of a shared library, or the soname defined in the= =20 shared library? The file name of the shared lib is stored in callgrind file= s=20 via "ob=3D" (meaning: ELF object). It would be nice if we could use the sam= e. BTW, what are you using this for? In callgrind, I can relate metrics to=20 instruction addresses, and KCachegrind has assembler annotation. It needs t= he=20 libraries file name to call "objdump" to get disassembled code. It seems quite natural for me to also do code coverage on this level. Then = you=20 would also get information for a source line like: "only 20% of instruction= s=20 attributed to this source line are executed". Josef |
|
From: Benoit P. <ben...@en...> - 2005-04-25 15:56:22
|
Le lun 25/04/2005 =E0 17:42, Nicholas Nethercote a =E9crit : > On Mon, 25 Apr 2005, Benoit Peccatte wrote: >=20 > > In my coverage tool, I need to call VG(demangle). However it is not > > exported from the core. Is there a way to call it properly from a tool = ? >=20 > It would require making it tool-visible by moving it from core.h to=20 > tool.h. Are you printing out function/method names as part of the=20 > coverage information? Exact. > AFAICT a coverage tool will need a couple of other changes to the=20 > core/tool interface -- to provide the ability to get all the debug line=20 > information about a file, which requires one or two extra functions. Yes, now I'm using my own in the tool (mostly pasted from the core), but it would be great if this could be available. > BTW, are you doing this work against the Subversion repository? (See=20 > http://www.valgrind.org/devel/cvs_svn.html) You should do so, as the=20 > intermediate representation has changed significantly in order to support= =20 > multiple architectures such as AMD64 and PPC. Sorry I didn't mention thi= s=20 > earlier. I'm using the svn version from 10 days ago. > How far advanced is your tool? I'll be interested to see how it compares= =20 > with mine :) It should be usable within a few days. |
|
From: <sv...@va...> - 2005-04-25 15:49:16
|
Author: sewardj
Date: 2005-04-25 16:49:10 +0100 (Mon, 25 Apr 2005)
New Revision: 3566
Modified:
trunk/coregrind/vg_main.c
Log:
For the time being, disable chasing across basic block boundaries.
This fools the redirector to the extent that that strlen et al do not
get reliably intercepted, and hence makes memcheck report some false
errors. Fixing the redirector properly really entails getting rid of
the circularity between the two memory allocators, but that is more
than I have time to sort out right now.
Modified: trunk/coregrind/vg_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_main.c 2005-04-25 15:42:57 UTC (rev 3565)
+++ trunk/coregrind/vg_main.c 2005-04-25 15:49:10 UTC (rev 3566)
@@ -1581,6 +1581,15 @@
=20
LibVEX_default_VexControl(& VG_(clo_vex_control));
=20
+ /* For the time being, disable chasing across basic block
+ boundaries. This fools the redirector to the extent that that
+ strlen et al do not get reliably intercepted, and hence makes
+ memcheck report some false errors. Fixing the redirector
+ properly really entails getting rid of the circularity between
+ the two memory allocators, but that is more than I have time to
+ sort out right now. */
+ VG_(clo_vex_control).guest_chase_thresh =3D 0;
+
/* parse the options we have (only the options we care about now) */
for (i =3D 1; i < vg_argc; i++) {
=20
|
|
From: <sv...@va...> - 2005-04-25 15:43:19
|
Author: sewardj
Date: 2005-04-25 16:42:57 +0100 (Mon, 25 Apr 2005)
New Revision: 3565
Modified:
trunk/coregrind/vg_malloc2.c
Log:
Use __FUNCTION__ correctly.
Modified: trunk/coregrind/vg_malloc2.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_malloc2.c 2005-04-25 11:11:44 UTC (rev 3564)
+++ trunk/coregrind/vg_malloc2.c 2005-04-25 15:42:57 UTC (rev 3565)
@@ -390,14 +390,16 @@
if (init_done) {
VG_(printf)(
"\nTool error:\n"
- " __FUNCTION__ cannot be called after the first allocation.\n"=
);
+ "%s cannot be called after the first allocation.\n",
+ __PRETTY_FUNCTION__);
VG_(exit)(1);
}
// This limit is no special figure, just something not too big
if (rz_szB > 128) {
VG_(printf)(
"\nTool error:\n"
- " __FUNCTION__ passed a too-big value (%llu)", (ULong)rz_szB);
+ " %s passed a too-big value (%llu)",=20
+ __PRETTY_FUNCTION__, (ULong)rz_szB);
VG_(exit)(1);
}
client_malloc_redzone_szB =3D rz_szB;
|
|
From: Nicholas N. <nj...@cs...> - 2005-04-25 15:42:16
|
On Mon, 25 Apr 2005, Benoit Peccatte wrote: > In my coverage tool, I need to call VG(demangle). However it is not > exported from the core. Is there a way to call it properly from a tool ? It would require making it tool-visible by moving it from core.h to tool.h. Are you printing out function/method names as part of the coverage information? AFAICT a coverage tool will need a couple of other changes to the core/tool interface -- to provide the ability to get all the debug line information about a file, which requires one or two extra functions. > I found that valgrind sometime calls SK_(discard_basic_block_info) . I > don't understand what this means. Is it that there was an error ? Is is > because the corresponding library was unloaded ? Sometimes Valgrind removes code translations from its cache, usually because the code cache has filled up. If a tool maintains extra state about each translation, it needs to be told to flush that state when translations are removed. To enable this, the tool must call VG_(needs_basic_block_discards)(). Cachegrind uses this facility. Your profiler may or may not need to use this facility, depending on how exactly it works. BTW, are you doing this work against the Subversion repository? (See http://www.valgrind.org/devel/cvs_svn.html) You should do so, as the intermediate representation has changed significantly in order to support multiple architectures such as AMD64 and PPC. Sorry I didn't mention this earlier. How far advanced is your tool? I'll be interested to see how it compares with mine :) N |
|
From: Benoit P. <ben...@en...> - 2005-04-25 15:23:58
|
In my coverage tool, I need to call VG(demangle). However it is not exported from the core. Is there a way to call it properly from a tool ? I found that valgrind sometime calls SK_(discard_basic_block_info) . I don't understand what this means. Is it that there was an error ? Is is because the corresponding library was unloaded ? |
|
From: Benoit P. <ben...@en...> - 2005-04-25 15:09:06
|
Le ven 22/04/2005 =E0 18:52, Josef Weidendorfer a =E9crit : > On Friday 22 April 2005 16:59, Benoit Peccatte wrote: > > > How do you detect source lines with code never executed? > > > > Valgrind reads a part of the dwarf informations (which are available > > when you compile with -g option). Debug informations contain a list of > > locations where code can be found. I read all of them for each segment > > and thus know what could be run. >=20 > Ah, good. I didn't know you can iterate over debug info in a Valgrind too= l. Well, I didn't use directly valgrind functions. I copied needed structures from vg_symtab.h into the tool's header. I know that's not perfectly clean, but it works for now.=20 > > How can I specify or get values for summary such as percentage=20 > > of executed code by function, by file or by soname ? >=20 > As said above, cg_annotate sums up this itself. The same with KCachegrind= . > The formula could be specified on the command line, or given in the data = file. > KCachegrind supports this by adding a line in the header like > event: Coverage =3D Executed / DebugInfo > and will calculate everything itself. But note that currently there is no= =20 > support for parsing "/" in formulas. Ok, I understand now. Yes I would need the '/' then, but I can't see where the '+' is parsed.=20 As the format is extensible, I'd like to keep a new information associated with each file name : the soname where it has been found. Can I add a so=3D... before fl=3D... ? > I just looked, and I think it was for STABS. > See http://kcachegrind.sourceforge.net/patch-0.2b-valgrind-1.0.4.gz, the = part=20 > for vg_symtab2.c. Thanks. > > Yes it is, I work on a big project with many sub directories. I don't > > want the user to find himself where is each source file, especially if > > the software can do it automaticly. >=20 > With KCachegrind, you only have to specify the base of the source tree, i= t=20 > will recurse into subdirs automatically. I thought the same is true for=20 > cg_annotate, but if not, this should be easy to add. The project I'm working on have several files with the same name. This is not sufficient. |
|
From: <js...@ac...> - 2005-04-25 03:02:45
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-04-25 03:50:00 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow insn_mmx: valgrind ./insn_mmx insn_mmxext: (skipping, prereq failed: ../../../tests/cputest x86-mmxext) insn_sse: valgrind ./insn_sse insn_sse2: (skipping, prereq failed: ../../../tests/cputest x86-sse2) int: valgrind ./int pushpopseg: valgrind ./pushpopseg rcl_assert: valgrind ./rcl_assert seg_override: valgrind ./seg_override -- Finished tests in none/tests/x86 ------------------------------------ yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 201 tests, 5 stderr failures, 0 stdout failures ================= memcheck/tests/pth_once (stderr) memcheck/tests/scalar (stderr) memcheck/tests/threadederrno (stderr) memcheck/tests/writev (stderr) corecheck/tests/fdleak_fcntl (stderr) make: *** [regtest] Error 1 |
|
From: <sv...@va...> - 2005-04-25 02:38:34
|
Author: sewardj
Date: 2005-04-25 03:38:28 +0100 (Mon, 25 Apr 2005)
New Revision: 3563
Modified:
trunk/coregrind/vg_main.c
Log:
More debug printing
Modified: trunk/coregrind/vg_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_main.c 2005-04-25 02:37:56 UTC (rev 3562)
+++ trunk/coregrind/vg_main.c 2005-04-25 02:38:28 UTC (rev 3563)
@@ -2169,15 +2169,15 @@
start allocating more memory (note: heap is OK, it's just mmap
which is the problem here). */
if (start >=3D VG_(client_end) && start < VG_(valgrind_last)) {
- if (0)
- VG_(printf)("init1: %p-%p prot %s\n",
- start, start+size, VG_(prot_str)(prot));
+ VG_(debugLog)(2, "main",
+ "valgrind-seg: %p-%p prot 0x%x file=3D%s\n",
+ start, start+size, prot, filename);
VG_(map_file_segment)(start, size, prot,
- SF_MMAP|SF_NOSYMS|SF_VALGRIND,
- dev, ino, foffset, filename);
+ SF_MMAP|SF_NOSYMS|SF_VALGRIND,
+ dev, ino, foffset, filename);
/* update VG_(valgrind_last) if it looks wrong */
if (start+size > VG_(valgrind_last))
- VG_(valgrind_last) =3D start+size-1;
+ VG_(valgrind_last) =3D start+size-1;
}
}
=20
@@ -2205,9 +2205,9 @@
is_stack_segment=20
=3D (start =3D=3D VG_(clstk_base) && (start+size) =3D=3D VG_(clstk=
_end));
=20
- if (0)
- VG_(printf)("init2: %p-%p prot %s stack=3D%d\n",
- start, start+size, VG_(prot_str)(prot), is_stack_segment);
+ VG_(debugLog)(2, "main",
+ "any-seg: %p-%p prot 0x%x stack=3D%d file=3D%s\n",
+ start, start+size, prot, is_stack_segment, filename);
=20
if (is_stack_segment)
flags =3D SF_STACK | SF_GROWDOWN;
|
|
From: <sv...@va...> - 2005-04-25 02:38:00
|
Author: sewardj
Date: 2005-04-25 03:37:56 +0100 (Mon, 25 Apr 2005)
New Revision: 3562
Modified:
trunk/coregrind/m_debuglog.c
Log:
More printing fine-tuning
Modified: trunk/coregrind/m_debuglog.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuglog.c 2005-04-25 02:05:54 UTC (rev 3561)
+++ trunk/coregrind/m_debuglog.c 2005-04-25 02:37:56 UTC (rev 3562)
@@ -456,7 +456,7 @@
if (level > loglevel)
return;
=20
- indent =3D 1*level - 1;
+ indent =3D 2*level - 1;
if (indent < 1) indent =3D 1;
=20
buf.n =3D 0;
|
|
From: Tom H. <to...@co...> - 2005-04-25 02:31:44
|
Nightly build on dunsmere ( athlon, Fedora Core 3 ) started at 2005-04-25 03:30:04 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... failed Last 20 lines of log.verbose follow gcc -Wmissing-prototypes -Winline -Wall -Wshadow -O -g -mpreferred-stack-boundary=2 -DELFSZ=32 -fno-omit-frame-pointer -Wno-long-long -o valgrind -static -g ume.o stage1.o m_debuglog.o jmp_with_stack.o if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../coregrind -I../coregrind -I.. -I../coregrind/x86 -I../coregrind/x86 -I../coregrind/linux -I../coregrind/x86-linux -I../include -I../include -I../include/x86 -I../include/linux -I../include/x86-linux -I/tmp/valgrind.2913/vex/pub -DVG_LIBDIR="\"/tmp/valgrind.2913/Inst/lib/valgrind"\" -I./demangle -DKICKSTART_BASE=0xb0000000 -DVG_PLATFORM="x86-linux" -Wmissing-prototypes -Winline -Wall -Wshadow -O -g -mpreferred-stack-boundary=2 -DELFSZ=32 -fno-omit-frame-pointer -fpie -Wno-long-long -MT stage2-m_errormgr.o -MD -MP -MF ".deps/stage2-m_errormgr.Tpo" -c -o stage2-m_errormgr.o `test -f 'm_errormgr.c' || echo './'`m_errormgr.c; \ then mv -f ".deps/stage2-m_errormgr.Tpo" ".deps/stage2-m_errormgr.Po"; else rm -f ".deps/stage2-m_errormgr.Tpo"; exit 1; fi if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../coregrind -I../coregrind -I.. -I../coregrind/x86 -I../coregrind/x86 -I../coregrind/linux -I../coregrind/x86-linux -I../include -I../include -I../include/x86 -I../include/linux -I../include/x86-linux -I/tmp/valgrind.2913/vex/pub -DVG_LIBDIR="\"/tmp/valgrind.2913/Inst/lib/valgrind"\" -I./demangle -DKICKSTART_BASE=0xb0000000 -DVG_PLATFORM="x86-linux" -Wmissing-prototypes -Winline -Wall -Wshadow -O -g -mpreferred-stack-boundary=2 -DELFSZ=32 -fno-omit-frame-pointer -fpie -Wno-long-long -MT stage2-m_execontext.o -MD -MP -MF ".deps/stage2-m_execontext.Tpo" -c -o stage2-m_execontext.o `test -f 'm_execontext.c' || echo './'`m_execontext.c; \ then mv -f ".deps/stage2-m_execontext.Tpo" ".deps/stage2-m_execontext.Po"; else rm -f ".deps/stage2-m_execontext.Tpo"; exit 1; fi if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../coregrind -I../coregrind -I.. -I../coregrind/x86 -I../coregrind/x86 -I../coregrind/linux -I../coregrind/x86-linux -I../include -I../include -I../include/x86 -I../include/linux -I../include/x86-linux -I/tmp/valgrind.2913/vex/pub -DVG_LIBDIR="\"/tmp/valgrind.2913/Inst/lib/valgrind"\" -I./demangle -DKICKSTART_BASE=0xb0000000 -DVG_PLATFORM="x86-linux" -Wmissing-prototypes -Winline -Wall -Wshadow -O -g -mpreferred-stack-boundary=2 -DELFSZ=32 -fno-omit-frame-pointer -fpie -Wno-long-long -MT stage2-m_stacktrace.o -MD -MP -MF ".deps/stage2-m_stacktrace.Tpo" -c -o stage2-m_stacktrace.o `test -f 'm_stacktrace.c' || echo './'`m_stacktrace.c; \ then mv -f ".deps/stage2-m_stacktrace.Tpo" ".deps/stage2-m_stacktrace.Po"; else rm -f ".deps/stage2-m_stacktrace.Tpo"; exit 1; fi if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../coregrind -I../coregrind -I.. -I../coregrind/x86 -I../coregrind/x86 -I../coregrind/linux -I../coregrind/x86-linux -I../include -I../include -I../include/x86 -I../include/linux -I../include/x86-linux -I/tmp/valgrind.2913/vex/pub -DVG_LIBDIR="\"/tmp/valgrind.2913/Inst/lib/valgrind"\" -I./demangle -DKICKSTART_BASE=0xb0000000 -DVG_PLATFORM="x86-linux" -Wmissing-prototypes -Winline -Wall -Wshadow -O -g -mpreferred-stack-boundary=2 -DELFSZ=32 -fno-omit-frame-pointer -fpie -Wno-long-long -MT stage2-m_debuglog.o -MD -MP -MF ".deps/stage2-m_debuglog.Tpo" -c -o stage2-m_debuglog.o `test -f 'm_debuglog.c' || echo './'`m_debuglog.c; \ then mv -f ".deps/stage2-m_debuglog.Tpo" ".deps/stage2-m_debuglog.Po"; else rm -f ".deps/stage2-m_debuglog.Tpo"; exit 1; fi m_debuglog.c: In function `local_sys_write_stderr': m_debuglog.c:63: error: can't find a register in class `BREG' while reloading `asm' make[4]: *** [stage2-m_debuglog.o] Error 1 make[4]: Leaving directory `/tmp/valgrind.2913/valgrind/coregrind' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/tmp/valgrind.2913/valgrind/coregrind' make[2]: *** [all] Error 2 make[2]: Leaving directory `/tmp/valgrind.2913/valgrind/coregrind' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/valgrind.2913/valgrind' make: *** [all] Error 2 |
|
From: Tom H. <th...@cy...> - 2005-04-25 02:30:52
|
Nightly build on audi ( i686, Red Hat 9 ) started at 2005-04-25 03:25:02 BST 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 == 175 tests, 16 stderr failures, 4 stdout failures ================= memcheck/tests/error_counts (stdout) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/leakotron (stdout) memcheck/tests/mempool (stderr) memcheck/tests/metadata (stdout) memcheck/tests/metadata (stderr) memcheck/tests/nanoleak (stderr) memcheck/tests/nanoleak_supp (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/scalar (stderr) memcheck/tests/scalar_exit_group (stderr) memcheck/tests/scalar_supp (stderr) memcheck/tests/trivialleak (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) none/tests/x86/sigcontext (stdout) none/tests/x86/sigcontext (stderr) |
|
From: Tom H. <to...@co...> - 2005-04-25 02:26:19
|
Nightly build on dunsmere ( Fedora Core 3 ) started at 2005-04-25 03:20:03 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow insn_mmx: valgrind ./insn_mmx insn_mmxext: valgrind ./insn_mmxext insn_sse: valgrind ./insn_sse insn_sse2: (skipping, prereq failed: ../../../tests/cputest x86-sse2) int: valgrind ./int sh: line 1: 2734 Segmentation fault VALGRINDLIB=/tmp/valgrind.9503/valgrind/.in_place /tmp/valgrind.9503/valgrind/./coregrind/valgrind --command-line-only=yes --memcheck:leak-check=no --addrcheck:leak-check=no --tool=none ./int >int.stdout.out 2>int.stderr.out pushpopseg: valgrind ./pushpopseg rcl_assert: valgrind ./rcl_assert seg_override: valgrind ./seg_override -- Finished tests in none/tests/x86 ------------------------------------ yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 207 tests, 4 stderr failures, 0 stdout failures ================= memcheck/tests/execve (stderr) memcheck/tests/execve2 (stderr) memcheck/tests/scalar (stderr) memcheck/tests/scalar_supp (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2005-04-25 02:22:30
|
Nightly build on audi ( Red Hat 9 ) started at 2005-04-25 03:15:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow fpu_lazy_eflags: valgrind ./fpu_lazy_eflags insn_basic: valgrind ./insn_basic insn_cmov: valgrind ./insn_cmov insn_fpu: valgrind ./insn_fpu insn_mmx: valgrind ./insn_mmx insn_mmxext: valgrind ./insn_mmxext insn_sse: valgrind ./insn_sse insn_sse2: (skipping, prereq failed: ../../../tests/cputest x86-sse2) int: valgrind ./int pushpopseg: valgrind ./pushpopseg rcl_assert: valgrind ./rcl_assert seg_override: valgrind ./seg_override -- Finished tests in none/tests/x86 ------------------------------------ yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 206 tests, 1 stderr failure, 0 stdout failures ================= memcheck/tests/scalar (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2005-04-25 02:20:51
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2005-04-25 03:15:02 BST 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 == 174 tests, 21 stderr failures, 4 stdout failures ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/error_counts (stdout) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/leakotron (stdout) memcheck/tests/match-overrun (stderr) memcheck/tests/mempool (stderr) memcheck/tests/metadata (stdout) memcheck/tests/metadata (stderr) memcheck/tests/nanoleak (stderr) memcheck/tests/nanoleak_supp (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/scalar (stderr) memcheck/tests/scalar_exit_group (stderr) memcheck/tests/scalar_supp (stderr) memcheck/tests/threadederrno (stderr) memcheck/tests/trivialleak (stderr) memcheck/tests/vgtest_ume (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) none/tests/x86/sigcontext (stdout) none/tests/x86/sigcontext (stderr) |
|
From: Tom H. <th...@cy...> - 2005-04-25 02:16:41
|
Nightly build on honda ( x86_64, Fedora Core 3 ) started at 2005-04-25 03:10:05 BST 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 == 156 tests, 84 stderr failures, 21 stdout failures ================= memcheck/tests/addressable (stdout) memcheck/tests/addressable (stderr) memcheck/tests/badaddrvalue (stdout) memcheck/tests/badaddrvalue (stderr) memcheck/tests/badfree-2trace (stderr) memcheck/tests/badfree (stderr) memcheck/tests/badjump (stderr) memcheck/tests/badjump2 (stderr) memcheck/tests/badloop (stderr) memcheck/tests/badpoll (stderr) memcheck/tests/badrw (stderr) memcheck/tests/brk (stderr) memcheck/tests/brk2 (stderr) memcheck/tests/buflen_check (stderr) memcheck/tests/clientperm (stdout) memcheck/tests/clientperm (stderr) memcheck/tests/custom_alloc (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/doublefree (stderr) memcheck/tests/error_counts (stdout) memcheck/tests/errs1 (stderr) memcheck/tests/execve (stderr) memcheck/tests/execve2 (stderr) memcheck/tests/exitprog (stderr) memcheck/tests/fprw (stderr) memcheck/tests/fwrite (stdout) memcheck/tests/fwrite (stderr) memcheck/tests/inits (stderr) memcheck/tests/inline (stdout) memcheck/tests/inline (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/leakotron (stdout) memcheck/tests/malloc1 (stderr) memcheck/tests/malloc2 (stderr) memcheck/tests/malloc3 (stdout) memcheck/tests/malloc3 (stderr) memcheck/tests/manuel1 (stdout) memcheck/tests/manuel1 (stderr) memcheck/tests/manuel2 (stdout) memcheck/tests/manuel2 (stderr) memcheck/tests/manuel3 (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/memalign2 (stderr) memcheck/tests/memalign_test (stderr) memcheck/tests/memcmptest (stdout) memcheck/tests/memcmptest (stderr) memcheck/tests/mempool (stderr) memcheck/tests/metadata (stdout) memcheck/tests/metadata (stderr) memcheck/tests/mismatches (stderr) memcheck/tests/mmaptest (stderr) memcheck/tests/nanoleak (stderr) memcheck/tests/nanoleak_supp (stderr) memcheck/tests/new_nothrow (stderr) memcheck/tests/new_override (stdout) memcheck/tests/new_override (stderr) memcheck/tests/null_socket (stderr) memcheck/tests/overlap (stdout) memcheck/tests/overlap (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/post-syscall (stdout) memcheck/tests/post-syscall (stderr) memcheck/tests/realloc1 (stderr) memcheck/tests/realloc2 (stderr) memcheck/tests/realloc3 (stderr) memcheck/tests/scalar (stderr) memcheck/tests/scalar_exit_group (stderr) memcheck/tests/scalar_fork (stderr) memcheck/tests/scalar_supp (stderr) memcheck/tests/scalar_vfork (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/signal2 (stdout) memcheck/tests/signal2 (stderr) memcheck/tests/sigprocmask (stderr) memcheck/tests/str_tester (stderr) memcheck/tests/supp1 (stderr) memcheck/tests/supp2 (stderr) memcheck/tests/suppfree (stderr) memcheck/tests/threadederrno (stdout) memcheck/tests/threadederrno (stderr) memcheck/tests/toobig-allocs (stderr) memcheck/tests/trivialleak (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stdout) memcheck/tests/weirdioctl (stderr) memcheck/tests/writev (stderr) memcheck/tests/zeropage (stdout) memcheck/tests/zeropage (stderr) corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_creat (stderr) corecheck/tests/fdleak_dup (stderr) corecheck/tests/fdleak_dup2 (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_open (stderr) corecheck/tests/fdleak_pipe (stderr) corecheck/tests/fdleak_socketpair (stderr) massif/tests/toobig-allocs (stderr) none/tests/faultstatus (stderr) none/tests/selfrun (stdout) none/tests/selfrun (stderr) none/tests/yield (stdout) |
|
From: Tom H. <th...@cy...> - 2005-04-25 02:11:50
|
Nightly build on alvis ( Red Hat 7.3 ) started at 2005-04-25 03:05:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow == 205 tests, 17 stderr failures, 0 stdout failures ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/distinguished-writes (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/pth_once (stderr) memcheck/tests/scalar (stderr) memcheck/tests/threadederrno (stderr) memcheck/tests/vgtest_ume (stderr) addrcheck/tests/leak-0 (stderr) addrcheck/tests/leak-cycle (stderr) addrcheck/tests/leak-regroot (stderr) addrcheck/tests/leak-tree (stderr) make: *** [regtest] Error 1 |
|
From: <sv...@va...> - 2005-04-25 02:06:03
|
Author: sewardj
Date: 2005-04-25 03:05:54 +0100 (Mon, 25 Apr 2005)
New Revision: 3561
Modified:
trunk/coregrind/vg_main.c
Log:
Print debugging info at various places in the startup sequence.
Modified: trunk/coregrind/vg_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_main.c 2005-04-25 02:04:54 UTC (rev 3560)
+++ trunk/coregrind/vg_main.c 2005-04-25 02:05:54 UTC (rev 3561)
@@ -2404,12 +2404,6 @@
build the segment skip-list.
*/
=20
-static int prmap(char *start, char *end, const char *perm, off_t off,=20
- int maj, int min, int ino, void* dummy) {
- printf("mapping %10p-%10p %s %02x:%02x %d\n",
- start, end, perm, maj, min, ino);
- return True;
-}
=20
/* This may be needed before m_mylibc is OK to run. */
static Int local_strcmp ( const HChar* s1, const HChar* s2 )
@@ -2493,14 +2487,11 @@
// Check we were launched by stage1
// p: none
//--------------------------------------------------------------
+ VG_(debugLog)(1, "main", "Doing scan_auxv()\n");
{
- void* init_sp =3D argv - 1;
- padfile =3D scan_auxv(init_sp);
+ void* init_sp =3D argv - 1;
+ padfile =3D scan_auxv(init_sp);
}
- if (0) {
- printf("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D main() =3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D\n");
- foreach_map(prmap, /*dummy*/NULL);
- }
=20
//--------------------------------------------------------------
// Look for alternative libdir =20
@@ -2516,6 +2507,7 @@
// Pre-process the command line.
// p: none
//--------------------------------------------------------------
+ VG_(debugLog)(1, "main", "Preprocess command line opts\n");
get_command_line(argc, argv, &vg_argc, &vg_argv, &cl_argv);
pre_process_cmd_line_options(&need_help, &tool, &exec);
=20
@@ -2529,6 +2521,7 @@
// p: set-libdir [for VG_(libdir)]
// p: pre_process_cmd_line_options() [for 'tool']
//--------------------------------------------------------------
+ VG_(debugLog)(1, "main", "Loading tool\n");
load_tool(tool, &toolinfo, &preload);
=20
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
@@ -2540,6 +2533,7 @@
// Finalise address space layout
// p: load_tool() [for 'toolinfo']
//--------------------------------------------------------------
+ VG_(debugLog)(1, "main", "Laying out remaining space\n");
layout_remaining_space( (Addr) & argc, toolinfo->shadow_ratio );
=20
//--------------------------------------------------------------
@@ -2547,6 +2541,7 @@
// p: pre_process_cmd_line_options() [for 'exec', 'need_help']
// p: layout_remaining_space [so there's space]
//--------------------------------------------------------------
+ VG_(debugLog)(1, "main", "Loading client\n");
load_client(cl_argv, exec, need_help, &info, &client_eip);
=20
//--------------------------------------------------------------
@@ -2562,6 +2557,7 @@
// p: set-libdir [for VG_(libdir)]
// p: load_tool() [for 'preload']
//--------------------------------------------------------------
+ VG_(debugLog)(1, "main", "Setup client env\n");
env =3D fix_environment(envp, preload);
=20
//--------------------------------------------------------------
@@ -2569,18 +2565,20 @@
// p: load_client() [for 'info']
// p: fix_environment() [for 'env']
//--------------------------------------------------------------
+ VG_(debugLog)(1, "main", "Setup client stack\n");
{=20
- void* init_sp =3D argv - 1;
+ void* init_sp =3D argv - 1;
=20
- sp_at_startup =3D setup_client_stack(init_sp, cl_argv, env, &info,
- &client_auxv);
- free(env);
+ sp_at_startup =3D setup_client_stack(init_sp, cl_argv, env, &info,
+ &client_auxv);
+ free(env);
}
=20
- if (0)
- printf("entry=3D%p client esp=3D%p vg_argc=3D%d brkbase=3D%p\n",
- (void*)client_eip, (void*)sp_at_startup, vg_argc,=20
- (void*)VG_(brk_base));
+ VG_(debugLog)(2, "main",
+ "Client info: "
+ "entry=3D%p client esp=3D%p vg_argc=3D%d brkbase=3D%=
p\n",
+ (void*)client_eip, (void*)sp_at_startup, vg_argc,=20
+ (void*)VG_(brk_base) );
=20
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
// Finished setting up operating environment. Now initialise
@@ -2591,12 +2589,14 @@
// setup file descriptors
// p: n/a
//--------------------------------------------------------------
+ VG_(debugLog)(1, "main", "Setup file descriptors\n");
setup_file_descriptors();
=20
//--------------------------------------------------------------
// Build segment map (Valgrind segments only)
// p: tl_pre_clo_init() [to setup new_mem_startup tracker]
//--------------------------------------------------------------
+ VG_(debugLog)(1, "main", "Parse /proc/self/maps (round 1)\n");
VG_(parse_procselfmaps) ( build_valgrind_map_callback );
=20
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
@@ -2611,6 +2611,7 @@
// p: parse_procselfmaps [so VG segments are setup so tool c=
an
// call VG_(malloc)]
//--------------------------------------------------------------
+ VG_(debugLog)(1, "main", "Initialise the tool\n");
(*toolinfo->tl_pre_clo_init)();
VG_(sanity_check_needs)();
=20
@@ -2627,6 +2628,7 @@
// Determine CPU architecture and subarchitecture
// p: none
//--------------------------------------------------------------
+ VG_(debugLog)(1, "main", "Check CPU arch/subarch\n");
{ Bool ok =3D VGA_(getArchAndSubArch)(
& VG_(vex_arch), & VG_(vex_subarch) );
if (!ok) {
@@ -2652,6 +2654,7 @@
// p: setup_client_stack() [for 'sp_at_startup']
// p: init tool [for 'new_mem_startup']
//--------------------------------------------------------------
+ VG_(debugLog)(1, "main", "Parse /proc/self/maps (round 2)\n");
sp_at_startup___global_arg =3D sp_at_startup;
VG_(parse_procselfmaps) ( build_segment_map_callback ); /* everythin=
g */
sp_at_startup___global_arg =3D 0;
@@ -2683,6 +2686,7 @@
/* Hook to delay things long enough so we can get the pid and
attach GDB in another shell. */
if (VG_(clo_wait_for_gdb)) {
+ VG_(debugLog)(1, "main", "Wait for GDB\n");
VG_(printf)("pid=3D%d, entering delay loop\n", VG_(getpid)());
/* jrs 20050206: I don't understand why this works on x86. On
amd64 the obvious analogues (jump *$rip or jump *$rcx) don't
@@ -2696,13 +2700,16 @@
// Search for file descriptors that are inherited from our parent
// p: process_cmd_line_options [for VG_(clo_track_fds)]
//--------------------------------------------------------------
- if (VG_(clo_track_fds))
+ if (VG_(clo_track_fds)) {
+ VG_(debugLog)(1, "main", "Init preopened fds\n");
VG_(init_preopened_fds)();
+ }
=20
//--------------------------------------------------------------
// Initialise the scheduler
// p: setup_file_descriptors() [else VG_(safe_fd)() breaks]
//--------------------------------------------------------------
+ VG_(debugLog)(1, "main", "Initialise scheduler\n");
VG_(scheduler_init)();
=20
//--------------------------------------------------------------
@@ -2712,6 +2719,7 @@
// setup_client_stack() [for 'sp_at_startup']
// setup_scheduler() [for the rest of state 1 stuff]
//--------------------------------------------------------------
+ VG_(debugLog)(1, "main", "Initialise thread 1's state\n");
VGA_(init_thread1state)(client_eip, sp_at_startup, &VG_(threads)[1].a=
rch );
=20
// Tell the tool that we just wrote to the registers.
@@ -2730,6 +2738,7 @@
// p: n/a
//--------------------------------------------------------------
// Nb: temporarily parks the saved blocking-mask in saved_sigmask.
+ VG_(debugLog)(1, "main", "Initialise signal management\n");
VG_(sigstartup_actions)();
=20
//--------------------------------------------------------------
@@ -2753,8 +2762,10 @@
// Read suppression file
// p: process_cmd_line_options() [for VG_(clo_suppressions)]
//--------------------------------------------------------------
- if (VG_(needs).core_errors || VG_(needs).tool_errors)
+ if (VG_(needs).core_errors || VG_(needs).tool_errors) {
+ VG_(debugLog)(1, "main", "Load suppressions\n");
VG_(load_suppressions)();
+ }
=20
//--------------------------------------------------------------
// Initialise translation table and translation cache
@@ -2762,6 +2773,7 @@
// aren't identified as part of the client, which would waste
// > 20M of virtual address space.]
//--------------------------------------------------------------
+ VG_(debugLog)(1, "main", "Initialise TT/TC\n");
VG_(init_tt_tc)();
=20
//--------------------------------------------------------------
@@ -2769,6 +2781,7 @@
// p: parse_procselfmaps? [XXX for debug info?]
// p: init_tt_tc [so it can call VG_(search_transtab) safely]
//--------------------------------------------------------------
+ VG_(debugLog)(1, "main", "Initialise redirects\n");
VG_(setup_code_redirect_table)();
VGP_(setup_redirects)();
=20
@@ -2795,6 +2808,7 @@
=20
vg_assert(VG_(master_tid) =3D=3D 1);
=20
+ VG_(debugLog)(1, "main", "Running thread 1\n");
VGA_(main_thread_wrapper)(1);
=20
abort();
|
|
From: <sv...@va...> - 2005-04-25 02:05:09
|
Author: sewardj
Date: 2005-04-25 03:04:54 +0100 (Mon, 25 Apr 2005)
New Revision: 3560
Modified:
trunk/coregrind/m_debuglog.c
Log:
Print a bit more prettily.
Modified: trunk/coregrind/m_debuglog.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuglog.c 2005-04-25 01:36:56 UTC (rev 3559)
+++ trunk/coregrind/m_debuglog.c 2005-04-25 02:04:54 UTC (rev 3560)
@@ -448,22 +448,27 @@
const HChar* format, ... )
{
UInt ret, pid;
+ Int indent;
va_list vargs;
printf_buf buf;
+
=20
if (level > loglevel)
return;
=20
+ indent =3D 1*level - 1;
+ if (indent < 1) indent =3D 1;
+
buf.n =3D 0;
buf.buf[0] =3D 0;
pid =3D local_sys_getpid();
- (void)myvprintf_str ( add_to_buf, &buf, 0, 1, "<", False );
- (void)myvprintf_int64 ( add_to_buf, &buf, 0, 10, 5, (ULong)pid );
- (void)myvprintf_str ( add_to_buf, &buf, 0, 1, ",", False );
+ (void)myvprintf_str ( add_to_buf, &buf, 0, 2, "--", False );
+ (void)myvprintf_int64 ( add_to_buf, &buf, 0, 10, 1, (ULong)pid );
+ (void)myvprintf_str ( add_to_buf, &buf, 0, 1, ":", False );
(void)myvprintf_int64 ( add_to_buf, &buf, 0, 10, 1, (ULong)level );
- (void)myvprintf_str ( add_to_buf, &buf, 0, 1, ",", False );
+ (void)myvprintf_str ( add_to_buf, &buf, 0, 1, ":", False );
(void)myvprintf_str ( add_to_buf, &buf, 0, 8, (HChar*)modulename, Fal=
se );
- (void)myvprintf_str ( add_to_buf, &buf, 0, 2, "> ", False );
+ (void)myvprintf_str ( add_to_buf, &buf, 0, indent, "", False );
=20
va_start(vargs,format);
=20
|
|
From: Tom H. <th...@cy...> - 2005-04-25 02:03:06
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2005-04-25 03:00:03 BST 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 == 156 tests, 84 stderr failures, 20 stdout failures ================= memcheck/tests/addressable (stdout) memcheck/tests/addressable (stderr) memcheck/tests/badaddrvalue (stdout) memcheck/tests/badaddrvalue (stderr) memcheck/tests/badfree-2trace (stderr) memcheck/tests/badfree (stderr) memcheck/tests/badjump (stderr) memcheck/tests/badjump2 (stderr) memcheck/tests/badloop (stderr) memcheck/tests/badpoll (stderr) memcheck/tests/badrw (stderr) memcheck/tests/brk (stderr) memcheck/tests/brk2 (stderr) memcheck/tests/buflen_check (stderr) memcheck/tests/clientperm (stdout) memcheck/tests/clientperm (stderr) memcheck/tests/custom_alloc (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/doublefree (stderr) memcheck/tests/error_counts (stdout) memcheck/tests/errs1 (stderr) memcheck/tests/execve (stderr) memcheck/tests/execve2 (stderr) memcheck/tests/exitprog (stderr) memcheck/tests/fprw (stderr) memcheck/tests/fwrite (stdout) memcheck/tests/fwrite (stderr) memcheck/tests/inits (stderr) memcheck/tests/inline (stdout) memcheck/tests/inline (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/leakotron (stdout) memcheck/tests/malloc1 (stderr) memcheck/tests/malloc2 (stderr) memcheck/tests/malloc3 (stdout) memcheck/tests/malloc3 (stderr) memcheck/tests/manuel1 (stdout) memcheck/tests/manuel1 (stderr) memcheck/tests/manuel2 (stdout) memcheck/tests/manuel2 (stderr) memcheck/tests/manuel3 (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/memalign2 (stderr) memcheck/tests/memalign_test (stderr) memcheck/tests/memcmptest (stdout) memcheck/tests/memcmptest (stderr) memcheck/tests/mempool (stderr) memcheck/tests/metadata (stdout) memcheck/tests/metadata (stderr) memcheck/tests/mismatches (stderr) memcheck/tests/mmaptest (stderr) memcheck/tests/nanoleak (stderr) memcheck/tests/nanoleak_supp (stderr) memcheck/tests/new_nothrow (stderr) memcheck/tests/new_override (stdout) memcheck/tests/new_override (stderr) memcheck/tests/null_socket (stderr) memcheck/tests/overlap (stdout) memcheck/tests/overlap (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/post-syscall (stdout) memcheck/tests/post-syscall (stderr) memcheck/tests/realloc1 (stderr) memcheck/tests/realloc2 (stderr) memcheck/tests/realloc3 (stderr) memcheck/tests/scalar (stderr) memcheck/tests/scalar_exit_group (stderr) memcheck/tests/scalar_fork (stderr) memcheck/tests/scalar_supp (stderr) memcheck/tests/scalar_vfork (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/signal2 (stdout) memcheck/tests/signal2 (stderr) memcheck/tests/sigprocmask (stderr) memcheck/tests/str_tester (stderr) memcheck/tests/supp1 (stderr) memcheck/tests/supp2 (stderr) memcheck/tests/suppfree (stderr) memcheck/tests/threadederrno (stdout) memcheck/tests/threadederrno (stderr) memcheck/tests/toobig-allocs (stderr) memcheck/tests/trivialleak (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stdout) memcheck/tests/weirdioctl (stderr) memcheck/tests/writev (stderr) memcheck/tests/zeropage (stdout) memcheck/tests/zeropage (stderr) corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_creat (stderr) corecheck/tests/fdleak_dup (stderr) corecheck/tests/fdleak_dup2 (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_open (stderr) corecheck/tests/fdleak_pipe (stderr) corecheck/tests/fdleak_socketpair (stderr) massif/tests/toobig-allocs (stderr) none/tests/faultstatus (stderr) none/tests/selfrun (stdout) none/tests/selfrun (stderr) |
|
From: <sv...@va...> - 2005-04-25 01:37:02
|
Author: sewardj
Date: 2005-04-25 02:36:56 +0100 (Mon, 25 Apr 2005)
New Revision: 3559
Added:
trunk/coregrind/m_debuglog.c
trunk/coregrind/pub_core_debuglog.h
Modified:
trunk/coregrind/Makefile.am
trunk/coregrind/stage1.c
trunk/coregrind/vg_main.c
trunk/coregrind/vg_messages.c
trunk/coregrind/vg_mylibc.c
trunk/coregrind/vg_symtypes.c
trunk/include/tool.h.base
Log:
Add a new module: the debug-logger. For a while now, we've used the
same logging mechanism to emit both end-user messages and debugging-
valgrind-itself messages. This commit creates a new mechanism for the
latter purpose.
The main feature of m_debuglog is that it has zero dependencies on any
other module and therefore can safely operate all the way through
stage1 and stage2 startup. It is restricted to emitting debug info on
file descriptor 2 (stderr), but that's not a big deal.
As a result of this change the basic formatted-print routines
(vprintf) have been moved from vg_mylibc.c into m_debuglog, so that
m_debuglog remains standalone.
The %y format string is currently disabled, since supporting it ("show
symbol corresponding to this address") would create a dependency from
m_debuglog to the entire debug-info reading machinery and all the
stuff that depends on, thereby making a nonsense of m_debuglog being
standalone. Its omission does not seem to cause any regression tests
to fail, though.
The debug logger is activated with "-d". More "-d"s make it more
verbose.
m_debuglog.o is linked into both stage1 and stage2, but as it is
completely standalone this causes no particular problems.
Modified: trunk/coregrind/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/Makefile.am 2005-04-24 14:34:42 UTC (rev 3558)
+++ trunk/coregrind/Makefile.am 2005-04-25 01:36:56 UTC (rev 3559)
@@ -14,7 +14,7 @@
=20
AM_CPPFLAGS +=3D -DVG_LIBDIR=3D"\"$(valdir)"\" -I$(srcdir)/demangle \
-DKICKSTART_BASE=3D@KICKSTART_BASE@ \
- -DVG_PLATFORM=3D"\"$(VG_PLATFORM)"\"
+ -DVG_PLATFORM=3D"$(VG_PLATFORM)"
AM_CFLAGS =3D $(WERROR) -Wmissing-prototypes -Winline -Wall -Wshadow -O =
-g @ARCH_CORE_AM_CFLAGS@
AM_CFLAGS +=3D -fno-omit-frame-pointer
=20
@@ -35,6 +35,8 @@
pub_core_errormgr.h \
pub_core_execontext.h \
pub_core_stacktrace.h \
+ pub_core_sigframe.h \
+ pub_core_debuglog.h \
ume.h \
vg_symtab2.h \
vg_symtypes.h \
@@ -51,6 +53,7 @@
ume.c \
\
stage1.c \
+ m_debuglog.c \
${VG_ARCH}/jmp_with_stack.c=20
valgrind_DEPENDENCIES =3D
valgrind_LDFLAGS=3D-static -g
@@ -60,6 +63,7 @@
m_errormgr.c \
m_execontext.c \
m_stacktrace.c \
+ m_debuglog.c \
ume.c \
\
vg_scheduler.c \
@@ -133,6 +137,7 @@
$(PERL) $(srcdir)/gen_toolint.pl proto < $(srcdir)/toolfuncs.def > $@=
|| rm -f $@
$(PERL) $(srcdir)/gen_toolint.pl struct < $(srcdir)/toolfuncs.def >> $@=
|| rm -f $@
=20
+
vg_inject_so_SOURCES =3D vg_intercept.c
vg_inject_so_CFLAGS =3D $(AM_CFLAGS) -fpic
vg_inject_so_LDADD =3D -ldl
Added: trunk/coregrind/m_debuglog.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuglog.c 2005-04-24 14:34:42 UTC (rev 3558)
+++ trunk/coregrind/m_debuglog.c 2005-04-25 01:36:56 UTC (rev 3559)
@@ -0,0 +1,483 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Debug (not-for-user) logging; also vprintf. m_debuglog.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward=20
+ js...@ac...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+
+/* Performs low-level debug logging that can safely run immediately
+ after startup. To minimise the dependencies on any other parts of
+ the system, the only place the debug output may go is file
+ descriptor 2 (stderr).
+*/
+/* This is the first-initialised module in the entire system!
+ Therefore it is CRITICAL that it does not depend on any other code
+ running first. Hence only the following very limited includes. We
+ cannot depend (directly or indirectly) on any dynamic memory
+ allocation facilities, nor on the m_libc facilities, since the
+ latter depend on this module. DO NOT MESS WITH THESE INCLUDES
+ UNLESS YOU ARE 100% CERTAIN YOU UNDERSTAND THE CONSEQUENCES.
+*/
+/* This module is also different from all others in the sense that it
+ is linked into both stage1 and stage2. =20
+*/
+#include "basic_types.h" /* basic types */
+#include "pub_core_debuglog.h" /* our own iface */
+
+
+/*------------------------------------------------------------*/
+/*--- Stuff to make us completely independent. ---*/
+/*------------------------------------------------------------*/
+
+/* ----- x86-linux specifics ----- */
+
+#if VG_PLATFORM =3D=3D x86-linux
+
+static UInt local_sys_write_stderr ( HChar* buf, Int n )
+{
+ UInt __res;
+ __asm__ volatile ("int $0x80"
+ : "=3Da" (__res)
+ : "0" (4), /* __NR_write */
+ "b" (2), /* stderr */
+ "c" (buf),
+ "d" (n) );
+ if (__res < 0)=20
+ __res =3D -1;
+ return __res;
+}
+
+static UInt local_sys_getpid ( void )
+{
+ UInt __res;
+ __asm__ volatile ("int $0x80"
+ : "=3Da" (__res)
+ : "0" (20) /* __NR_getpid */);
+ return __res;
+}
+
+
+#else
+#error Unknown VG_PLATFORM
+#endif
+
+
+/* ----- generic ----- */
+
+/* strlen, so we don't need m_libc */
+static Int local_strlen ( const HChar* str )
+{
+ Int i =3D 0;
+ while (str[i] !=3D 0) i++;
+ return i;
+}
+
+static HChar local_toupper ( HChar c )
+{
+ if (c >=3D 'a' && c <=3D 'z')
+ return c + ('A' - 'a');=20
+ else
+ return c;
+}
+
+/* Emit buf[0 .. n-1] to stderr. Unfortunately platform-specific.=20
+*/
+static void emit ( HChar* buf, Int n )
+{
+ if (n >=3D 1)
+ (void)local_sys_write_stderr(buf, n);
+}
+
+
+/*------------------------------------------------------------*/
+/*--- A simple, generic, vprintf implementation. ---*/
+/*------------------------------------------------------------*/
+
+/* -----------------------------------------------
+ Distantly derived from:
+
+ vprintf replacement for Checker.
+ Copyright 1993, 1994, 1995 Tristan Gingold
+ Written September 1993 Tristan Gingold
+ Tristan Gingold, 8 rue Parmentier, F-91120 PALAISEAU, FRANCE
+
+ (Checker itself was GPL'd.)
+ ----------------------------------------------- */
+
+/* Some flags. */
+#define VG_MSG_SIGNED 1 /* The value is signed. */
+#define VG_MSG_ZJUSTIFY 2 /* Must justify with '0'. */
+#define VG_MSG_LJUSTIFY 4 /* Must justify on the left. */
+#define VG_MSG_PAREN 8 /* Parenthesize if present (for %y) */
+#define VG_MSG_COMMA 16 /* Add commas to numbers (for %d, %u) */
+
+
+/* Copy a string into the buffer. */
+static=20
+UInt myvprintf_str ( void(*send)(HChar,void*),
+ void* send_arg2,
+ Int flags,=20
+ Int width,=20
+ HChar* str,=20
+ Bool capitalise )
+{
+# define MAYBE_TOUPPER(ch) (capitalise ? local_toupper(ch) : (ch))
+ UInt ret =3D 0;
+ Int i, extra;
+ Int len =3D local_strlen(str);
+
+ if (width =3D=3D 0) {
+ ret +=3D len;
+ for (i =3D 0; i < len; i++)
+ send(MAYBE_TOUPPER(str[i]), send_arg2);
+ return ret;
+ }
+
+ if (len > width) {
+ ret +=3D width;
+ for (i =3D 0; i < width; i++)
+ send(MAYBE_TOUPPER(str[i]), send_arg2);
+ return ret;
+ }
+
+ extra =3D width - len;
+ if (flags & VG_MSG_LJUSTIFY) {
+ ret +=3D extra;
+ for (i =3D 0; i < extra; i++)
+ send(' ', send_arg2);
+ }
+ ret +=3D len;
+ for (i =3D 0; i < len; i++)
+ send(MAYBE_TOUPPER(str[i]), send_arg2);
+ if (!(flags & VG_MSG_LJUSTIFY)) {
+ ret +=3D extra;
+ for (i =3D 0; i < extra; i++)
+ send(' ', send_arg2);
+ }
+
+# undef MAYBE_TOUPPER
+ return ret;
+}
+
+
+/* Write P into the buffer according to these args:
+ * If SIGN is true, p is a signed.
+ * BASE is the base.
+ * If WITH_ZERO is true, '0' must be added.
+ * WIDTH is the width of the field.
+ */
+static=20
+UInt myvprintf_int64 ( void(*send)(HChar,void*),=20
+ void* send_arg2,
+ Int flags,=20
+ Int base,=20
+ Int width,=20
+ ULong p )
+{
+ HChar buf[40];
+ Int ind =3D 0;
+ Int i, nc =3D 0;
+ Bool neg =3D False;
+ HChar* digits =3D "0123456789ABCDEF";
+ UInt ret =3D 0;
+
+ if (base < 2 || base > 16)
+ return ret;
+=20
+ if ((flags & VG_MSG_SIGNED) && (Long)p < 0) {
+ p =3D - (Long)p;
+ neg =3D True;
+ }
+
+ if (p =3D=3D 0)
+ buf[ind++] =3D '0';
+ else {
+ while (p > 0) {
+ if (flags & VG_MSG_COMMA && 10 =3D=3D base &&
+ 0 =3D=3D (ind-nc) % 3 && 0 !=3D ind)=20
+ {
+ buf[ind++] =3D ',';
+ nc++;
+ }
+ buf[ind++] =3D digits[p % base];
+ p /=3D base;
+ }
+ }
+
+ if (neg)
+ buf[ind++] =3D '-';
+
+ if (width > 0 && !(flags & VG_MSG_LJUSTIFY)) {
+ for(; ind < width; ind++) {
+ /* vg_assert(ind < 39); */
+ if (ind > 39) {
+ buf[39] =3D 0;
+ break;
+ }
+ buf[ind] =3D (flags & VG_MSG_ZJUSTIFY) ? '0': ' ';
+ }
+ }
+
+ /* Reverse copy to buffer. */
+ ret +=3D ind;
+ for (i =3D ind -1; i >=3D 0; i--) {
+ send(buf[i], send_arg2);
+ }
+ if (width > 0 && (flags & VG_MSG_LJUSTIFY)) {
+ for(; ind < width; ind++) {
+ ret++;
+ /* Never pad with zeroes on RHS -- changes the value! */
+ send(' ', send_arg2);
+ }
+ }
+ return ret;
+}
+
+
+/* A simple vprintf(). */
+/* EXPORTED */
+UInt
+VG_(debugLog_vprintf) (=20
+ void(*send)(HChar,void*),=20
+ void* send_arg2,
+ const HChar* format,=20
+ va_list vargs
+)
+{
+ UInt ret =3D 0;
+ Int i;
+ Int flags;
+ Int width;
+ Bool is_long;
+
+ /* We assume that vargs has already been initialised by the=20
+ caller, using va_start, and that the caller will similarly
+ clean up with va_end.
+ */
+
+ for (i =3D 0; format[i] !=3D 0; i++) {
+ if (format[i] !=3D '%') {
+ send(format[i], send_arg2);
+ ret++;
+ continue;
+ }
+ i++;
+ /* A '%' has been found. Ignore a trailing %. */
+ if (format[i] =3D=3D 0)
+ break;
+ if (format[i] =3D=3D '%') {
+ /* `%%' is replaced by `%'. */
+ send('%', send_arg2);
+ ret++;
+ continue;
+ }
+ flags =3D 0;
+ is_long =3D False;
+ width =3D 0; /* length of the field. */
+ if (format[i] =3D=3D '(') {
+ flags |=3D VG_MSG_PAREN;
+ i++;
+ }
+ /* If ',' follows '%', commas will be inserted. */
+ if (format[i] =3D=3D ',') {
+ flags |=3D VG_MSG_COMMA;
+ i++;
+ }
+ /* If '-' follows '%', justify on the left. */
+ if (format[i] =3D=3D '-') {
+ flags |=3D VG_MSG_LJUSTIFY;
+ i++;
+ }
+ /* If '0' follows '%', pads will be inserted. */
+ if (format[i] =3D=3D '0') {
+ flags |=3D VG_MSG_ZJUSTIFY;
+ i++;
+ }
+ /* Compute the field length. */
+ while (format[i] >=3D '0' && format[i] <=3D '9') {
+ width *=3D 10;
+ width +=3D format[i++] - '0';
+ }
+ while (format[i] =3D=3D 'l') {
+ i++;
+ is_long =3D True;
+ }
+
+ switch (format[i]) {
+ case 'd': /* %d */
+ flags |=3D VG_MSG_SIGNED;
+ if (is_long)
+ ret +=3D myvprintf_int64(send, send_arg2, flags, 10, widt=
h,=20
+ (ULong)(va_arg (vargs, Long)));
+ else
+ ret +=3D myvprintf_int64(send, send_arg2, flags, 10, widt=
h,=20
+ (ULong)(va_arg (vargs, Int)));
+ break;
+ case 'u': /* %u */
+ if (is_long)
+ ret +=3D myvprintf_int64(send, send_arg2, flags, 10, widt=
h,=20
+ (ULong)(va_arg (vargs, ULong)));
+ else
+ ret +=3D myvprintf_int64(send, send_arg2, flags, 10, widt=
h,=20
+ (ULong)(va_arg (vargs, UInt)));
+ break;
+ case 'p': /* %p */
+ ret +=3D 2;
+ send('0',send_arg2);
+ send('x',send_arg2);
+ ret +=3D myvprintf_int64(send, send_arg2, flags, 16, width,=20
+ (ULong)((UWord)va_arg (vargs, void *)=
));
+ break;
+ case 'x': /* %x */
+ if (is_long)
+ ret +=3D myvprintf_int64(send, send_arg2, flags, 16, widt=
h,=20
+ (ULong)(va_arg (vargs, ULong)));
+ else
+ ret +=3D myvprintf_int64(send, send_arg2, flags, 16, widt=
h,=20
+ (ULong)(va_arg (vargs, UInt)));
+ break;
+ case 'c': /* %c */
+ ret++;
+ send(va_arg (vargs, int), send_arg2);
+ break;
+ case 's': case 'S': { /* %s */
+ char *str =3D va_arg (vargs, char *);
+ if (str =3D=3D (char*) 0) str =3D "(null)";
+ ret +=3D myvprintf_str(send, send_arg2,=20
+ flags, width, str, format[i]=3D=3D'S');
+ break;
+ }
+// case 'y': { /* %y - print symbol */
+// Char buf[100];
+// Char *cp =3D buf;
+// Addr a =3D va_arg(vargs, Addr);
+//
+// if (flags & VG_MSG_PAREN)
+// *cp++ =3D '(';
+// if (VG_(get_fnname_w_offset)(a, cp, sizeof(buf)-4)) {
+// if (flags & VG_MSG_PAREN) {
+// cp +=3D VG_(strlen)(cp);
+// *cp++ =3D ')';
+// *cp =3D '\0';
+// }
+// ret +=3D myvprintf_str(send, send_arg2, flags, width, b=
uf, 0);
+// }
+// break;
+// }
+ default:
+ break;
+ }
+ }
+ return ret;
+}
+
+
+/*------------------------------------------------------------*/
+/*--- Debuglog stuff. ---*/
+/*------------------------------------------------------------*/
+
+/* Only print messages whose stated level is less than or equal to
+ this. By default, it makes this entire subsystem silent. */
+
+static Int loglevel =3D 0;
+
+/* EXPORTED */
+/* Module startup. */
+void VG_(debugLog_startup) ( Int level, HChar* who )
+{
+ if (level < 0) level =3D 0;
+ if (level > 10) level =3D 10;
+ loglevel =3D level;
+ VG_(debugLog)(1, "debuglog",=20
+ "DebugLog system started by %s, "
+ "level %d logging requested\n",=20
+ who, loglevel);
+}
+
+/* ------------ */
+
+typedef=20
+ struct {
+ HChar buf[100];
+ Int n;
+ }=20
+ printf_buf;
+
+static void add_to_buf ( HChar c, void* p )
+{
+ printf_buf* buf =3D (printf_buf*)p;
+
+ if (buf->n >=3D 100-10 /*paranoia*/ ) {
+ emit( buf->buf, local_strlen(buf->buf) );
+ buf->n =3D 0;
+ buf->buf[buf->n] =3D 0; =20
+ }
+ buf->buf[buf->n++] =3D c;
+ buf->buf[buf->n] =3D 0;
+}
+
+/* Send a logging message. Nothing is output unless 'level'
+ is <=3D the current loglevel. */
+/* EXPORTED */
+__attribute__((format(__printf__, 3, 4)))
+void VG_(debugLog) ( Int level, const HChar* modulename,
+ const HChar* format, ... )
+{
+ UInt ret, pid;
+ va_list vargs;
+ printf_buf buf;
+ =20
+ if (level > loglevel)
+ return;
+
+ buf.n =3D 0;
+ buf.buf[0] =3D 0;
+ pid =3D local_sys_getpid();
+ (void)myvprintf_str ( add_to_buf, &buf, 0, 1, "<", False );
+ (void)myvprintf_int64 ( add_to_buf, &buf, 0, 10, 5, (ULong)pid );
+ (void)myvprintf_str ( add_to_buf, &buf, 0, 1, ",", False );
+ (void)myvprintf_int64 ( add_to_buf, &buf, 0, 10, 1, (ULong)level );
+ (void)myvprintf_str ( add_to_buf, &buf, 0, 1, ",", False );
+ (void)myvprintf_str ( add_to_buf, &buf, 0, 8, (HChar*)modulename, Fal=
se );
+ (void)myvprintf_str ( add_to_buf, &buf, 0, 2, "> ", False );
+
+ va_start(vargs,format);
+ =20
+ ret =3D VG_(debugLog_vprintf) ( add_to_buf, &buf, format, vargs );
+
+ if (buf.n > 0) {
+ emit( buf.buf, local_strlen(buf.buf) );
+ }
+
+ va_end(vargs);
+}
+
+
+
+/*--------------------------------------------------------------------*/
+/*--- end m_debuglog.c ---*/
+/*--------------------------------------------------------------------*/
Added: trunk/coregrind/pub_core_debuglog.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/pub_core_debuglog.h 2005-04-24 14:34:42 UTC (rev 3558=
)
+++ trunk/coregrind/pub_core_debuglog.h 2005-04-25 01:36:56 UTC (rev 3559=
)
@@ -0,0 +1,83 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Debug (not-for-user) logging. pub_core_debuglog.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward
+ js...@ac...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_CORE_DEBUGLOG_H
+#define __PUB_CORE_DEBUGLOG_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module provides a low-level debug logging facility
+// that works through all the twists and turns of program startup. Is
+// is completely independent of everything, including all memory
+// facilities, and emits the debug log on file descriptor 2 (stderr).
+// This module is the first to be initialised at system startup.
+//
+// Because VG_(debugLog) does printf-style formatting, and because
+// this module depends on NO OTHERS, this module contains Valgrind's
+// vfprintf implementation too.
+//--------------------------------------------------------------------
+
+/* Gaaah! We don't want glibc dependencies, but there is no easy,
+ portable way to avoid using stdarg.h. */
+#include <stdarg.h>
+
+#include "core_asm.h" /* For definition of VG_ macro */
+
+/* There are no tool-visible exports from m_debuglog, hence no header
+ file for it. */
+/* #include "pub_tool_debuglog.h" */
+
+
+/* Module startup. */
+extern=20
+void VG_(debugLog_startup) ( Int level, HChar* who );
+
+/* Send debugging output. Nothing happens unless 'level'=20
+ does not exceed the logging threshold level. */
+extern
+__attribute__((format(__printf__, 3, 4)))
+void VG_(debugLog) ( Int level, const HChar* modulename,
+ const HChar* format, ... );
+
+/* A simple vprintf(). For each emitted byte, (*send) is called with
+ that byte, and 'send_arg2' as its second param. */
+extern
+UInt VG_(debugLog_vprintf) (=20
+ void (*send)(HChar,void*), /* byte sink */
+ void* send_arg2, /* 2nd arg for byte sink */
+ const HChar *format,=20
+ va_list vargs
+ );
+
+
+#endif // __PUB_CORE_DEBUGLOG_H
+
+/*--------------------------------------------------------------------*/
+/*--- end pub_core_debuglog.h ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/stage1.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/stage1.c 2005-04-24 14:34:42 UTC (rev 3558)
+++ trunk/coregrind/stage1.c 2005-04-25 01:36:56 UTC (rev 3559)
@@ -44,7 +44,9 @@
#include "core.h"
#include "ume.h"
#include "memcheck/memcheck.h"
+#include "pub_core_debuglog.h"
=20
+
static int stack[SIGSTKSZ*4];
=20
// Initial stack pointer, which points to argc.
@@ -300,6 +302,7 @@
foreach_map(prmap, /*dummy*/NULL);
}
=20
+ VG_(debugLog)(1, "stage1", "main2(): starting stage2\n");
jump_and_switch_stacks(
(Addr) esp, /* stack */
(Addr) info.init_eip /* where to */
@@ -314,7 +317,24 @@
{
struct rlimit rlim;
const char *cp;
+ int i, loglevel;
=20
+ /* Start the debugging-log system ASAP. First find out how many=20
+ "-d"s were specified. This is a pre-scan of the command line. */
+ loglevel =3D 0;
+ for (i =3D 1; i < argc; i++) {
+ if (argv[i][0] !=3D '-')
+ break;
+ if (0 =3D=3D strcmp(argv[i], "--"))=20
+ break;
+ if (0 =3D=3D strcmp(argv[i], "-d"))=20
+ loglevel++;
+ }
+
+ /* ... and start the debug logger. Now we can safely emit logging
+ messages all through startup. */
+ VG_(debugLog_startup)(loglevel, "Stage 1");
+
// Initial stack pointer is to argc, which is immediately before argv=
[0]
// on the stack. Nb: Assumes argc is word-aligned.
init_sp =3D argv - 1;
@@ -335,6 +355,7 @@
setrlimit(RLIMIT_AS, &rlim);
=20
/* move onto another stack so we can play with the main one */
+ VG_(debugLog)(1, "stage1", "main(): running main2() on new stack\n");
jump_and_switch_stacks(
(Addr) stack + sizeof(stack), /* stack */
(Addr) main2 /* where to */
Modified: trunk/coregrind/vg_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_main.c 2005-04-24 14:34:42 UTC (rev 3558)
+++ trunk/coregrind/vg_main.c 2005-04-25 01:36:56 UTC (rev 3559)
@@ -34,6 +34,7 @@
#include "ume.h"
#include "pub_core_execontext.h"
#include "pub_core_errormgr.h"
+#include "pub_core_debuglog.h"
=20
#include <dirent.h>
#include <dlfcn.h>
@@ -1672,6 +1673,10 @@
VG_CLO_STREQ(arg, "--quiet"))
VG_(clo_verbosity)--;
=20
+ else if (VG_CLO_STREQ(arg, "-d")) {
+ /* do nothing */
+ }
+
else VG_BOOL_CLO(arg, "--branchpred", VG_(clo_branchpred))
else VG_BOOL_CLO(arg, "--db-attach", VG_(clo_db_attach))
else VG_BOOL_CLO(arg, "--demangle", VG_(clo_demangle))
@@ -2406,6 +2411,22 @@
return True;
}
=20
+/* This may be needed before m_mylibc is OK to run. */
+static Int local_strcmp ( const HChar* s1, const HChar* s2 )
+{
+ while (True) {
+ if (*s1 =3D=3D 0 && *s2 =3D=3D 0) return 0;
+ if (*s1 =3D=3D 0) return -1;
+ if (*s2 =3D=3D 0) return 1;
+
+ if (*(UChar*)s1 < *(UChar*)s2) return -1;
+ if (*(UChar*)s1 > *(UChar*)s2) return 1;
+
+ s1++; s2++;
+ }
+}
+
+
int main(int argc, char **argv, char **envp)
{
char **cl_argv;
@@ -2420,7 +2441,7 @@
Addr sp_at_startup; /* client's SP at the point we gained control=
. */
UInt * client_auxv;
struct vki_rlimit zero =3D { 0, 0 };
- Int padfile;
+ Int padfile, loglevel, i;
=20
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
// Nb: startup is complex. Prerequisites are shown at every step.
@@ -2428,6 +2449,26 @@
// *** Be very careful when messing with the order ***
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=20
+ //--------------------------------------------------------------
+ // Start up the logging mechanism
+ // p: none
+ //--------------------------------------------------------------
+ /* Start the debugging-log system ASAP. First find out how many=20
+ "-d"s were specified. This is a pre-scan of the command line. */
+ loglevel =3D 0;
+ for (i =3D 1; i < argc; i++) {
+ if (argv[i][0] !=3D '-')
+ break;
+ if (0 =3D=3D local_strcmp(argv[i], "--"))=20
+ break;
+ if (0 =3D=3D local_strcmp(argv[i], "-d"))=20
+ loglevel++;
+ }
+
+ /* ... and start the debug logger. Now we can safely emit logging
+ messages all through startup. */
+ VG_(debugLog_startup)(loglevel, "Stage 2");
+
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
// Command line argument handling order:
// * If --help/--help-debug are present, show usage message=20
Modified: trunk/coregrind/vg_messages.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_messages.c 2005-04-24 14:34:42 UTC (rev 3558)
+++ trunk/coregrind/vg_messages.c 2005-04-25 01:36:56 UTC (rev 3559)
@@ -31,6 +31,7 @@
=20
=20
#include "core.h"
+#include "pub_core_debuglog.h" /* VG_(debugLog_vprintf) */
=20
#include <time.h>
#include <sys/time.h>
@@ -41,7 +42,7 @@
static char mbuf[M_MSGBUF];
static int n_mbuf;
=20
-static void add_to_buf ( Char c, void *p )
+static void add_to_buf ( HChar c, void *p )
{
if (n_mbuf >=3D (M_MSGBUF-1)) return;
mbuf[n_mbuf++] =3D c;
@@ -71,7 +72,7 @@
int count;
va_list vargs;
va_start(vargs,format);
- count =3D VG_(vprintf) ( add_to_buf, format, vargs, 0 );
+ count =3D VG_(debugLog_vprintf) ( add_to_buf, NULL, format, vargs );
va_end(vargs);
return count;
}
@@ -119,7 +120,7 @@
{
int count;
count =3D start_msg ( kind );
- count +=3D VG_(vprintf) ( add_to_buf, format, vargs, 0 );
+ count +=3D VG_(debugLog_vprintf) ( add_to_buf, NULL, format, vargs );
count +=3D end_msg();
return count;
}
Modified: trunk/coregrind/vg_mylibc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_mylibc.c 2005-04-24 14:34:42 UTC (rev 3558)
+++ trunk/coregrind/vg_mylibc.c 2005-04-25 01:36:56 UTC (rev 3559)
@@ -32,7 +32,9 @@
=20
#include "core.h"
#include "pub_core_stacktrace.h"
+#include "pub_core_debuglog.h" /* VG_(debugLog_vprintf) */
=20
+
/* ---------------------------------------------------------------------
Wrappers around system calls, and other stuff, to do with signals.
------------------------------------------------------------------ */
@@ -391,266 +393,6 @@
}
=20
=20
-/* ---------------------------------------------------------------------
- printf implementation. The key function, vg_vprintf(), emits chars=20
- into a caller-supplied function. Distantly derived from:
-
- vprintf replacement for Checker.
- Copyright 1993, 1994, 1995 Tristan Gingold
- Written September 1993 Tristan Gingold
- Tristan Gingold, 8 rue Parmentier, F-91120 PALAISEAU, FRANCE
-
- (Checker itself was GPL'd.)
- ------------------------------------------------------------------ */
-
-
-/* Some flags. */
-#define VG_MSG_SIGNED 1 /* The value is signed. */
-#define VG_MSG_ZJUSTIFY 2 /* Must justify with '0'. */
-#define VG_MSG_LJUSTIFY 4 /* Must justify on the left. */
-#define VG_MSG_PAREN 8 /* Parenthesize if present (for %y) */
-#define VG_MSG_COMMA 16 /* Add commas to numbers (for %d, %u) */
-
-/* Copy a string into the buffer. */
-static UInt
-myvprintf_str ( void(*send)(Char, void*), Int flags, Int width, Char* st=
r,=20
- Bool capitalise, void *send_arg )
-{
-# define MAYBE_TOUPPER(ch) (capitalise ? VG_(toupper)(ch) : (ch))
- UInt ret =3D 0;
- Int i, extra;
- Int len =3D VG_(strlen)(str);
-
- if (width =3D=3D 0) {
- ret +=3D len;
- for (i =3D 0; i < len; i++)
- send(MAYBE_TOUPPER(str[i]), send_arg);
- return ret;
- }
-
- if (len > width) {
- ret +=3D width;
- for (i =3D 0; i < width; i++)
- send(MAYBE_TOUPPER(str[i]), send_arg);
- return ret;
- }
-
- extra =3D width - len;
- if (flags & VG_MSG_LJUSTIFY) {
- ret +=3D extra;
- for (i =3D 0; i < extra; i++)
- send(' ', send_arg);
- }
- ret +=3D len;
- for (i =3D 0; i < len; i++)
- send(MAYBE_TOUPPER(str[i]), send_arg);
- if (!(flags & VG_MSG_LJUSTIFY)) {
- ret +=3D extra;
- for (i =3D 0; i < extra; i++)
- send(' ', send_arg);
- }
-
-# undef MAYBE_TOUPPER
-
- return ret;
-}
-
-/* Write P into the buffer according to these args:
- * If SIGN is true, p is a signed.
- * BASE is the base.
- * If WITH_ZERO is true, '0' must be added.
- * WIDTH is the width of the field.
- */
-static UInt
-myvprintf_int64 ( void(*send)(Char,void*), Int flags, Int base, Int widt=
h, ULong p, void *send_arg)
-{
- Char buf[40];
- Int ind =3D 0;
- Int i, nc =3D 0;
- Bool neg =3D False;
- Char *digits =3D "0123456789ABCDEF";
- UInt ret =3D 0;
-
- if (base < 2 || base > 16)
- return ret;
-=20
- if ((flags & VG_MSG_SIGNED) && (Long)p < 0) {
- p =3D - (Long)p;
- neg =3D True;
- }
-
- if (p =3D=3D 0)
- buf[ind++] =3D '0';
- else {
- while (p > 0) {
- if (flags & VG_MSG_COMMA && 10 =3D=3D base &&
- 0 =3D=3D (ind-nc) % 3 && 0 !=3D ind)=20
- {
- buf[ind++] =3D ',';
- nc++;
- }
- buf[ind++] =3D digits[p % base];
- p /=3D base;
- }
- }
-
- if (neg)
- buf[ind++] =3D '-';
-
- if (width > 0 && !(flags & VG_MSG_LJUSTIFY)) {
- for(; ind < width; ind++) {
- vg_assert(ind < 39);
- buf[ind] =3D (flags & VG_MSG_ZJUSTIFY) ? '0': ' ';
- }
- }
-
- /* Reverse copy to buffer. */
- ret +=3D ind;
- for (i =3D ind -1; i >=3D 0; i--) {
- send(buf[i], send_arg);
- }
- if (width > 0 && (flags & VG_MSG_LJUSTIFY)) {
- for(; ind < width; ind++) {
- ret++;
- send(' ', send_arg); // Never pad with zeroes on RHS -- change=
s the value!
- }
- }
- return ret;
-}
-
-
-/* A simple vprintf(). */
-UInt
-VG_(vprintf) ( void(*send)(Char,void*), const Char *format, va_list varg=
s, void *send_arg )
-{
- UInt ret =3D 0;
- int i;
- int flags;
- int width;
- Bool is_long;
-
- /* We assume that vargs has already been initialised by the=20
- caller, using va_start, and that the caller will similarly
- clean up with va_end.
- */
-
- for (i =3D 0; format[i] !=3D 0; i++) {
- if (format[i] !=3D '%') {
- send(format[i], send_arg);
- ret++;
- continue;
- }
- i++;
- /* A '%' has been found. Ignore a trailing %. */
- if (format[i] =3D=3D 0)
- break;
- if (format[i] =3D=3D '%') {
- /* `%%' is replaced by `%'. */
- send('%', send_arg);
- ret++;
- continue;
- }
- flags =3D 0;
- is_long =3D False;
- width =3D 0; /* length of the field. */
- if (format[i] =3D=3D '(') {
- flags |=3D VG_MSG_PAREN;
- i++;
- }
- /* If ',' follows '%', commas will be inserted. */
- if (format[i] =3D=3D ',') {
- flags |=3D VG_MSG_COMMA;
- i++;
- }
- /* If '-' follows '%', justify on the left. */
- if (format[i] =3D=3D '-') {
- flags |=3D VG_MSG_LJUSTIFY;
- i++;
- }
- /* If '0' follows '%', pads will be inserted. */
- if (format[i] =3D=3D '0') {
- flags |=3D VG_MSG_ZJUSTIFY;
- i++;
- }
- /* Compute the field length. */
- while (format[i] >=3D '0' && format[i] <=3D '9') {
- width *=3D 10;
- width +=3D format[i++] - '0';
- }
- while (format[i] =3D=3D 'l') {
- i++;
- is_long =3D True;
- }
-
- switch (format[i]) {
- case 'd': /* %d */
- flags |=3D VG_MSG_SIGNED;
- if (is_long)
- ret +=3D myvprintf_int64(send, flags, 10, width,=20
- (ULong)(va_arg (vargs, Long)), send_arg);
- else
- ret +=3D myvprintf_int64(send, flags, 10, width,=20
- (ULong)(va_arg (vargs, Int)), send_arg);
- break;
- case 'u': /* %u */
- if (is_long)
- ret +=3D myvprintf_int64(send, flags, 10, width,=20
- (ULong)(va_arg (vargs, ULong)), send_arg);
- else
- ret +=3D myvprintf_int64(send, flags, 10, width,=20
- (ULong)(va_arg (vargs, UInt)), send_arg);
- break;
- case 'p': /* %p */
- ret +=3D 2;
- send('0',send_arg);
- send('x',send_arg);
- ret +=3D myvprintf_int64(send, flags, 16, width,=20
- (ULong)((UWord)va_arg (vargs, void *)), send_arg);
- break;
- case 'x': /* %x */
- if (is_long)
- ret +=3D myvprintf_int64(send, flags, 16, width,=20
- (ULong)(va_arg (vargs, ULong)), send_arg);
- else
- ret +=3D myvprintf_int64(send, flags, 16, width,=20
- (ULong)(va_arg (vargs, UInt)), send_arg);
- break;
- case 'c': /* %c */
- ret++;
- send(va_arg (vargs, int), send_arg);
- break;
- case 's': case 'S': { /* %s */
- char *str =3D va_arg (vargs, char *);
- if (str =3D=3D (char*) 0) str =3D "(null)";
- ret +=3D myvprintf_str(send, flags, width, str, format[i]=3D=
=3D'S', send_arg);
- break;
- }
- case 'y': { /* %y - print symbol */
- Char buf[100];
- Char *cp =3D buf;
- Addr a =3D va_arg(vargs, Addr);
-
- if (flags & VG_MSG_PAREN)
- *cp++ =3D '(';
- if (VG_(get_fnname_w_offset)(a, cp, sizeof(buf)-4)) {
- if (flags & VG_MSG_PAREN) {
- cp +=3D VG_(strlen)(cp);
- *cp++ =3D ')';
- *cp =3D '\0';
- }
- ret +=3D myvprintf_str(send, flags, width, buf, 0, send_arg);
- }
-
- break;
- }
- default:
- break;
- }
- }
- return ret;
-}
-
-
/* A general replacement for printf(). Note that only low-level=20
debugging info should be sent via here. The official route is to
to use vg_message(). This interface is deprecated.
@@ -660,7 +402,7 @@
int n;
} printf_buf;
=20
-static void add_to_myprintf_buf ( Char c, void *p )
+static void add_to_myprintf_buf ( HChar c, void *p )
{
printf_buf *myprintf_buf =3D (printf_buf *)p;
=20
@@ -683,7 +425,8 @@
printf_buf myprintf_buf =3D {"",0};
va_start(vargs,format);
=20
- ret =3D VG_(vprintf) ( add_to_myprintf_buf, format, vargs, &myprintf_=
buf );
+ ret =3D VG_(debugLog_vprintf)=20
+ ( add_to_myprintf_buf, &myprintf_buf, format, vargs );
=20
if (myprintf_buf.n > 0 && VG_(clo_log_fd) >=3D 0) {
VG_(send_bytes_to_logging_sink)( myprintf_buf.buf, myprintf_buf.n =
);
@@ -695,7 +438,7 @@
}
=20
/* A general replacement for sprintf(). */
-static void add_to_vg_sprintf_buf ( Char c, void *p )
+static void add_to_vg_sprintf_buf ( HChar c, void *p )
{
char **vg_sprintf_ptr =3D p;
*(*vg_sprintf_ptr)++ =3D c;
@@ -709,7 +452,8 @@
=20
va_start(vargs,format);
=20
- ret =3D VG_(vprintf) ( add_to_vg_sprintf_buf, format, vargs, &vg_spri=
ntf_ptr );
+ ret =3D VG_(debugLog_vprintf)=20
+ ( add_to_vg_sprintf_buf, &vg_sprintf_ptr, format, vargs );
add_to_vg_sprintf_buf(0,&vg_sprintf_ptr);
=20
va_end(vargs);
@@ -1198,7 +942,7 @@
entered =3D True;
=20
va_start(vargs,format);
- VG_(vprintf) ( add_to_vg_sprintf_buf, format, vargs, &bufptr );
+ VG_(debugLog_vprintf) ( add_to_vg_sprintf_buf, &bufptr, format, vargs=
);
add_to_vg_sprintf_buf('\0', &bufptr);
va_end(vargs);
=20
Modified: trunk/coregrind/vg_symtypes.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_symtypes.c 2005-04-24 14:34:42 UTC (rev 3558)
+++ trunk/coregrind/vg_symtypes.c 2005-04-25 01:36:56 UTC (rev 3559)
@@ -29,6 +29,7 @@
=20
#include "core.h"
#include "vg_symtypes.h"
+#include "pub_core_debuglog.h" /* VG_(debugLog_vprintf) */
=20
typedef enum {
TyUnknown, /* unknown type */
@@ -501,12 +502,13 @@
}
}
=20
-static void bprintf(void (*send)(Char, void*), void *send_arg, const Cha=
r *fmt, ...)
+static=20
+void bprintf(void (*send)(HChar, void*), void *send_arg, const Char *fmt=
, ...)
{
va_list vargs;
=20
va_start(vargs, fmt);
- VG_(vprintf)(send, fmt, vargs, send_arg);
+ VG_(debugLog_vprintf)(send, send_arg, fmt, vargs);
va_end(vargs);
}
=20
@@ -667,7 +669,7 @@
static UInt describe_addr_bufsz;
=20
/* Add a character to the result buffer */
-static void describe_addr_addbuf(Char c,void *p) {
+static void describe_addr_addbuf(HChar c,void *p) {
if ((describe_addr_bufidx+1) >=3D describe_addr_bufsz) {
Char *n;
=20
Modified: trunk/include/tool.h.base
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/tool.h.base 2005-04-24 14:34:42 UTC (rev 3558)
+++ trunk/include/tool.h.base 2005-04-25 01:36:56 UTC (rev 3559)
@@ -318,8 +318,6 @@
extern UInt VG_(printf) ( const char *format, ... );
/* too noisy ... __attribute__ ((format (printf, 1, 2))) ; */
extern UInt VG_(sprintf) ( Char* buf, Char *format, ... );
-extern UInt VG_(vprintf) ( void(*send)(Char, void *),
- const Char *format, va_list vargs, void *send=
_arg );
=20
extern Int VG_(rename) ( Char* old_name, Char* new_name );
=20
|
|
From: Rex W. <wa...@gm...> - 2005-04-24 21:52:12
|
THanks. that is all I wanted to know. I wanted to know if the same principle used in callgrind could be used for dullard. THanks again. Rex. On 4/24/05, Josef Weidendorfer <Jos...@gm...> wrote: > On Friday 22 April 2005 15:48, Rex Walburn wrote: > > Hi > > You had mentioned the macro CALLGRIND_START_INSTRUMENTATION that can > > be used to start instrumentation at a particular point in the source > > code. So can I use this same macro for another tool like "dullard" > > which dumps out memory traces for an executable ? >=20 > Sorry, no. > This macro will be ignored when run with a Valgrind tool other than callg= rind. > You would have to add similar support to Dullard. > But perhaps it would be good to generalize this for all tools: A tool wit= h > different instrumentation levels should be able to specify this to Valgri= nd > core, which will handle all the rest, i.e. flush the translation cache on= a > change. Neverless, "dullard" would have to be changed to support such an > Valgrind extension. >=20 > Josef >=20 > > > > THanks > > Rex > |
|
From: Julian S. <js...@ac...> - 2005-04-24 18:18:18
|
> > Add intercepts for operator new(unsigned long) and operator
> > new[](unsigned long). The 32-bit ones take unsigned int args, not
> > unsigned longs, and so the existing name-set did not capture them.
>
> The parameters are actually std::size_t, which should be 32-bits on 32-bit
> platforms and 64-bits on 64-bit platforms, so I'm confused by this
> change...
Problem is this. If you compile this
int* p1 = new int;
int* p2 = new int[10];
on x86, the resulting assembly/object contains calls to _Znwj and _Znaj
respectively. But on amd64, those calls are to _Znwm and _Znam
instead. If you offer up those 4 symbols to c++filt, it says they are
operator new(unsigned int) (..j variants)
operator new[](unsigned int)
operator new(unsigned long) (..m variants)
operator new[](unsigned long)
from which I assume that the C++ name mangler dereferences all type
aliases -- which size_t must be -- before generating the mangled name.
Hence you end up with different names on the differently-word-sized
platforms.
J
|
|
From: Josef W. <Jos...@gm...> - 2005-04-24 18:02:03
|
On Friday 22 April 2005 15:48, Rex Walburn wrote: > Hi > You had mentioned the macro CALLGRIND_START_INSTRUMENTATION that can > be used to start instrumentation at a particular point in the source > code. So can I use this same macro for another tool like "dullard" > which dumps out memory traces for an executable ? Sorry, no. This macro will be ignored when run with a Valgrind tool other than callgrind. You would have to add similar support to Dullard. But perhaps it would be good to generalize this for all tools: A tool with different instrumentation levels should be able to specify this to Valgrind core, which will handle all the rest, i.e. flush the translation cache on a change. Neverless, "dullard" would have to be changed to support such an Valgrind extension. Josef > > THanks > Rex |
|
From: Josef W. <Jos...@gm...> - 2005-04-24 18:02:02
|
On Friday 22 April 2005 16:59, Benoit Peccatte wrote: > > How do you detect source lines with code never executed? > > Valgrind reads a part of the dwarf informations (which are available > when you compile with -g option). Debug informations contain a list of > locations where code can be found. I read all of them for each segment > and thus know what could be run. Ah, good. I didn't know you can iterate over debug info in a Valgrind tool. > That's a good idea, I'm reading the documentation. > > But I think I may make a simple interface to be able to do it without > kcachegrind. That will work automatically, because KCachegrind will be able to read the data without problems ;-) > > I would chose the following events related to a source line > > 1) "Line has debug info" (i.e. relevant code for coverage): Yes 1, No 0 > > 2) "Line was NOT executed" Yes: 1, No: 0 > > As cg_annotate sorts according highest values, the "NOT" in 2) is > > important for the overview: You get the sorted list of function where a > > lot of lines are never executed. > > We don't know when a line don't have debug info, we even don't know that it > exist. Yes of course. The programmer has to compile with -g. The thing is, that you want to know which lines have debug info. And you know about this. So I was a bit misleading: Every source line listed in the output of the tool would have a "1" for 1). I think you need this to calculate percentage, and still use the cachegrind format: It makes no sense to write percentage values into the output, because cg_annotate/KCachegrind will sum up events of lines to get the event count of a function, and summing makes no sense with percentage values. To be able to use the cachegrind format, cg_annotate will have to calculate the ratio. > What about an event like this : > events: Executed ExecCount > > Executed is 0 or 1 whereas ExecCount give the number of time each line was > executed. How do you get the percentage of executed lines in a function from this? Not that cg_annotate will sum up this itself from the events of the lines in the function, you can not specify this seperately. With my suggestion 1), this would give the number of lines with debug info in a function. > > It would be good here to define derived events like "2) divided by 1)", > > to get the percentage values calculated. This is interesting for > > cachegrind itself (e.g. cache hit ratio). I am sure a patch for > > cg_annotate is welcome. In KCachegrind, derived metrics are already > > possible, but only with operator "+". I would add "/" for you ;-) > > And callgrind even extends cachegrind's format to allow to specify > > derived metric formulas. > > I don't really understand here. Should I calculate the percentage withing > the tool ? My suggestion is to calculate the percentage in cg_annotate. > How can I specify or get values for summary such as percentage > of executed code by function, by file or by soname ? As said above, cg_annotate sums up this itself. The same with KCachegrind. The formula could be specified on the command line, or given in the data file. KCachegrind supports this by adding a line in the header like event: Coverage = Executed / DebugInfo and will calculate everything itself. But note that currently there is no support for parsing "/" in formulas. > > > > > I've got almost all data I need but I can't find in which directory > > > > > is a source file for a given symbol. Does valgrind read this in > > > > > formation ? > > > > > > > > I don't think so. > > > > > > Too bad, should I use a DWARF reader library ? > > > > A long time ago I had a local patch for prefixing every source file name > > with the directory name while loading the debug info... > > This is exactly whan I need, I would be glad if you could find it. I just looked, and I think it was for STABS. See http://kcachegrind.sourceforge.net/patch-0.2b-valgrind-1.0.4.gz, the part for vg_symtab2.c. > > > But is this needed? > > With cg_annotate / KCachegrind you can specify the directories where to > > look for source. Of course there is a problem if a program has source > > files with the same name. > > Yes it is, I work on a big project with many sub directories. I don't > want the user to find himself where is each source file, especially if > the software can do it automaticly. With KCachegrind, you only have to specify the base of the source tree, it will recurse into subdirs automatically. I thought the same is true for cg_annotate, but if not, this should be easy to add. Josef |