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
(21) |
2
(18) |
3
(19) |
4
(17) |
|
5
(6) |
6
(5) |
7
(9) |
8
(21) |
9
(16) |
10
(21) |
11
(22) |
|
12
(19) |
13
(19) |
14
(8) |
15
(16) |
16
(17) |
17
(16) |
18
(33) |
|
19
(33) |
20
(34) |
21
(32) |
22
(26) |
23
(23) |
24
(16) |
25
(21) |
|
26
(19) |
27
(7) |
28
(29) |
29
(27) |
30
(55) |
|
|
|
From: <sv...@va...> - 2005-06-12 20:51:22
|
Author: njn Date: 2005-06-12 21:51:09 +0100 (Sun, 12 Jun 2005) New Revision: 3902 Log: Improve comment. Modified: trunk/coregrind/pub_core_libcproc.h Modified: trunk/coregrind/pub_core_libcproc.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_libcproc.h 2005-06-12 17:47:24 UTC (rev 3901= ) +++ trunk/coregrind/pub_core_libcproc.h 2005-06-12 20:51:09 UTC (rev 3902= ) @@ -38,7 +38,8 @@ =20 #include "pub_tool_libcproc.h" =20 -/* The directory we look for all our auxillary files in */ +/* The directory we look for all our auxillary files in. Useful for + running Valgrind out of a build tree without having to do "make insta= ll". */ #define VALGRINDLIB "VALGRINDLIB" =20 /* Additional command-line arguments; they are overridden by actual |
|
From: Nicholas N. <nj...@cs...> - 2005-06-12 20:49:32
|
On Sun, 12 Jun 2005, Jeroen N. Witmond wrote: >> My question is: is the $VALGRINDLIB environment variable ever actually >> used to change the libdir to something other than the default? Could we >> safely kill it?? > > It is used by tests/vg_regtest.in. Perhaps it can be replaced by > LD_LIBRARY_PATH, but I haven't tested this. Oh, it's used to let you run Valgrind from a tree without having to do "make install". I use it every time I run Valgrind, but I forgot about it because it's hidden behind an alias. So I'll leave it in :) N |
|
From: Jeroen N. W. <jn...@xs...> - 2005-06-12 19:28:36
|
FYI an update on the status of valgrind and its regression test on Debian GNU/Linux 3.1, now that it has been offically released http://www.debian.org/News/2005/20050606 * A few failures in 3.0.0 can be handled with new or replaced .exp files: - valgrind/corecheck/tests/fdleak_fcntl.stderr.exp5 - valgrind/memcheck/tests/writev.stderr.exp4 - valgrind/memcheck/tests/xml1.stderr.exp (replacement) The first two also apply to valgrind-2.4.0, offset by -1. * In 3.0.0, test none/tests/x86/int reports vex x86->IR: unhandled instruction bytes: 0xCD 0x81 0xC7 0x4 ==722== ==722== Process terminating with default action of signal 4 (SIGILL) ==722== Illegal opcode at address 0x8048394 ==722== at 0x8048394: main (int.c:5) and test none/tests/faultstatus reports Test 5: vex x86->IR: unhandled instruction bytes: 0xF 0xB 0x5D 0xC3 FAIL: expected si_code==2, not 1 Test 6: vex x86->IR: unhandled instruction bytes: 0xCC 0x5D 0xC3 0x55 FAIL: expected signal 5, not 4 Test 7: vex x86->IR: unhandled instruction bytes: 0xCD 0x10 0x5D 0xC3 FAIL: expected signal 11, not 4 Test 8: vex x86->IR: unhandled instruction bytes: 0xCE 0x89 0x45 0xFC FAIL: expected signal 11, not 4 Test 9: vex x86->IR: unhandled instruction bytes: 0x62 0x5 0xC 0x90 FAIL: expected signal 11, not 4 $ gcc -v Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux Thread model: posix gcc version 3.3.5 (Debian 1:3.3.5-13) $ uname -a Linux DoornRoosje 2.4.26-1-386 #1 Tue Aug 24 13:31:19 JST 2004 i686 GNU/Linux * In 2.4.0, tests addrcheck/tests/leak-tree and memcheck/tests/leak-tree report the number of bytes different from what is recorded in the .exp file. I'm almost certain this can also be fixed with replaced .exp files. See file addrcheck/tests/leak-tree.stderr.diff. These problems do not occur in 3.0.0. * I've configured both valgrinds with --disable-tls to make the error in test none/tests/tls go away. The test for TLS during configuration reports a false positive. * And that's all. Jeroen. |
|
From: Jeroen N. W. <jn...@xs...> - 2005-06-12 18:27:53
|
> My question is: is the $VALGRINDLIB environment variable ever actually > used to change the libdir to something other than the default? Could we > safely kill it?? It is used by tests/vg_regtest.in. Perhaps it can be replaced by LD_LIBRARY_PATH, but I haven't tested this. Jeroen. |
|
From: <sv...@va...> - 2005-06-12 17:47:29
|
Author: njn
Date: 2005-06-12 18:47:24 +0100 (Sun, 12 Jun 2005)
New Revision: 3901
Log:
Move VG_(libdir) into m_libcproc.
Modified:
trunk/coregrind/m_libcproc.c
trunk/coregrind/m_main.c
trunk/include/pub_tool_libcproc.h
trunk/include/tool.h
Modified: trunk/coregrind/m_libcproc.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_libcproc.c 2005-06-12 17:26:29 UTC (rev 3900)
+++ trunk/coregrind/m_libcproc.c 2005-06-12 17:47:24 UTC (rev 3901)
@@ -46,6 +46,9 @@
Char** VG_(client_argv);
Char** VG_(client_envp);
=20
+/* Path to library directory */
+const Char *VG_(libdir) =3D VG_LIBDIR;
+
/* We do getenv without libc's help by snooping around in
VG_(client_envp) as determined at startup time. */
Char *VG_(getenv)(Char *varname)
Modified: trunk/coregrind/m_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/m_main.c 2005-06-12 17:26:29 UTC (rev 3900)
+++ trunk/coregrind/m_main.c 2005-06-12 17:47:24 UTC (rev 3901)
@@ -118,9 +118,6 @@
/* client executable */
Int VG_(clexecfd) =3D -1;
=20
-/* Path to library directory */
-const Char *VG_(libdir) =3D VG_LIBDIR;
-
/* our argc/argv */
static Int vg_argc;
static Char **vg_argv;
Modified: trunk/include/pub_tool_libcproc.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/include/pub_tool_libcproc.h 2005-06-12 17:26:29 UTC (rev 3900)
+++ trunk/include/pub_tool_libcproc.h 2005-06-12 17:47:24 UTC (rev 3901)
@@ -43,6 +43,9 @@
/* Looks up VG_(client_envp) */
extern Char* VG_(getenv) ( Char* name );
=20
+/* Path to all our library/aux files */
+extern const Char *VG_(libdir);
+
/* ---------------------------------------------------------------------
Important syscalls
------------------------------------------------------------------ */
Modified: trunk/include/tool.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/include/tool.h 2005-06-12 17:26:29 UTC (rev 3900)
+++ trunk/include/tool.h 2005-06-12 17:47:24 UTC (rev 3901)
@@ -52,15 +52,7 @@
programs do not need many threads. */
#define VG_N_THREADS 100
=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=3D=3D=3D=3D=3D=3D*/
-/*=3D=3D=3D Useful macros =
=3D=3D=3D*/
-/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
-
-/* Path to all our library/aux files */
-extern const Char *VG_(libdir);
-
-/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
/*=3D=3D=3D Useful stuff to call from generated code =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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
|
|
From: Nicholas N. <nj...@cs...> - 2005-06-12 17:46:05
|
Hi, I'm looking at the $VALGRINDLIB environment variable. It's related to VG_(libdir), which says where Valgrind's library files are. Basically, VG_(libdir) defaults to VG_LIBDIR (which is passed in from coregrind/Makefile.am), but it is overriden by $VALGRINDLIB if $VALGRINDLIB is set. The same is true in stage1, except this time the libdir variable is called "valgrind_lib". My question is: is the $VALGRINDLIB environment variable ever actually used to change the libdir to something other than the default? Could we safely kill it?? Thanks. N |
|
From: <sv...@va...> - 2005-06-12 17:26:32
|
Author: njn
Date: 2005-06-12 18:26:29 +0100 (Sun, 12 Jun 2005)
New Revision: 3900
Log:
Moved the last two functions out of linux/core_os.c, and removed it.
Removed:
trunk/coregrind/linux/
Modified:
trunk/configure.in
trunk/coregrind/Makefile.am
trunk/coregrind/core.h
trunk/coregrind/m_main.c
trunk/coregrind/m_scheduler/priv_sema.h
trunk/coregrind/m_syscalls/priv_syscalls-linux.h
trunk/coregrind/m_syscalls/syscalls-amd64-linux.c
trunk/coregrind/m_syscalls/syscalls-generic.c
trunk/coregrind/m_syscalls/syscalls-linux.c
trunk/coregrind/m_syscalls/syscalls-x86-linux.c
trunk/coregrind/pub_core_syscalls.h
Modified: trunk/configure.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/configure.in 2005-06-12 16:43:33 UTC (rev 3899)
+++ trunk/configure.in 2005-06-12 17:26:29 UTC (rev 3900)
@@ -433,7 +433,6 @@
coregrind/amd64/Makefile
coregrind/arm/Makefile
coregrind/x86/Makefile
- coregrind/linux/Makefile
addrcheck/Makefile
addrcheck/tests/Makefile
addrcheck/docs/Makefile
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-06-12 16:43:33 UTC (rev 3899)
+++ trunk/coregrind/Makefile.am 2005-06-12 17:26:29 UTC (rev 3900)
@@ -15,11 +15,11 @@
## But when doing 'make dist', we are interested in every arch/OS/platfo=
rm.
## That's what DIST_SUBDIRS specifies.
SUBDIRS =3D \
- $(VG_ARCH) $(VG_OS) \
+ $(VG_ARCH) \
$(MODULES) .
=20
DIST_SUBDIRS =3D \
- $(VG_ARCH_ALL) $(VG_OS_ALL) \
+ $(VG_ARCH_ALL) \
$(MODULES) .
=20
AM_CPPFLAGS +=3D -DVG_LIBDIR=3D"\"$(valdir)"\" \
@@ -129,7 +129,6 @@
m_sigframe/libsigframe.a \
m_syscalls/libsyscalls.a \
${VG_ARCH}/libarch.a \
- ${VG_OS}/libos.a \
@VEX_DIR@/libvex.a
=20
## These ones must be linked in with the --whole-archive flag, because t=
hey
Modified: trunk/coregrind/core.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/core.h 2005-06-12 16:43:33 UTC (rev 3899)
+++ trunk/coregrind/core.h 2005-06-12 17:26:29 UTC (rev 3900)
@@ -157,12 +157,6 @@
Addr esp_at_startup,
/*MOD*/ ThreadArchState* arch );
=20
-// Run a thread from beginning to end.=20
-extern VgSchedReturnCode VGO_(thread_wrapper)(Word /*ThreadId*/ tid);
-
-// wait until all other threads are dead
-extern void VGA_(reap_threads)(ThreadId self);
-
// For attaching the debugger
extern Int VGA_(ptrace_setregs_from_tst) ( Int pid, ThreadArchState* ar=
ch );
=20
Modified: trunk/coregrind/m_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/m_main.c 2005-06-12 16:43:33 UTC (rev 3899)
+++ trunk/coregrind/m_main.c 2005-06-12 17:26:29 UTC (rev 3900)
@@ -2867,7 +2867,7 @@
vg_assert(VG_(is_running_thread)(tid));
=20
// Wait for all other threads to exit.
- VGA_(reap_threads)(tid);
+ VG_(reap_threads)(tid);
=20
VG_(clo_model_pthreads) =3D False;
=20
@@ -2931,7 +2931,7 @@
sys_exit, do likewise; if the (last) thread stopped due to a fatal
signal, terminate the entire system with that same fatal signal. *=
/
VG_(debugLog)(1, "core_os",=20
- "VGO_(terminate_NORETURN)(tid=3D%lld)\n", (ULong)tid=
);
+ "VG_(terminate_NORETURN)(tid=3D%lld)\n", (ULong)tid)=
;
=20
vg_assert(VG_(count_living_threads)() =3D=3D 0);
=20
Modified: trunk/coregrind/m_scheduler/priv_sema.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/m_scheduler/priv_sema.h 2005-06-12 16:43:33 UTC (rev =
3899)
+++ trunk/coregrind/m_scheduler/priv_sema.h 2005-06-12 17:26:29 UTC (rev =
3900)
@@ -39,8 +39,7 @@
} vg_sema_t;
=20
// Nb: this may be OS-specific, but let's not factor it out until we
-// implement an OS port for which this isn't ok. Then we can rename the=
m
-// VGO_(sema_init)(), etc.
+// implement an OS port for which this isn't ok.
void VG_(sema_init) ( vg_sema_t *sema );
void VG_(sema_deinit) ( vg_sema_t *sema );
void VG_(sema_down) ( vg_sema_t *sema );
Modified: trunk/coregrind/m_syscalls/priv_syscalls-linux.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/m_syscalls/priv_syscalls-linux.h 2005-06-12 16:43:33 =
UTC (rev 3899)
+++ trunk/coregrind/m_syscalls/priv_syscalls-linux.h 2005-06-12 17:26:29 =
UTC (rev 3900)
@@ -33,6 +33,9 @@
=20
/* requires #include "priv_types_n_macros.h" */
=20
+// Run a thread from beginning to end.=20
+extern VgSchedReturnCode VG_(thread_wrapper)(Word /*ThreadId*/ tid);
+
DECL_TEMPLATE(linux, sys_exit_group);
=20
DECL_TEMPLATE(linux, sys_mount);
Modified: trunk/coregrind/m_syscalls/syscalls-amd64-linux.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_syscalls/syscalls-amd64-linux.c 2005-06-12 16:43:33=
UTC (rev 3899)
+++ trunk/coregrind/m_syscalls/syscalls-amd64-linux.c 2005-06-12 17:26:29=
UTC (rev 3900)
@@ -133,15 +133,15 @@
=20
VG_(debugLog)(1, "syscalls-amd64-linux",=20
"run_a_thread_NORETURN(tid=3D%lld): "
- "VGO_(thread_wrapper) called\n",
+ "VG_(thread_wrapper) called\n",
(ULong)tidW);
=20
/* Run the thread all the way through. */
- VgSchedReturnCode src =3D VGO_(thread_wrapper)(tid); =20
+ VgSchedReturnCode src =3D VG_(thread_wrapper)(tid); =20
=20
VG_(debugLog)(1, "syscalls-amd64-linux",=20
"run_a_thread_NORETURN(tid=3D%lld): "
- "VGO_(thread_wrapper) done\n",
+ "VG_(thread_wrapper) done\n",
(ULong)tidW);
=20
Int c =3D VG_(count_living_threads)();
Modified: trunk/coregrind/m_syscalls/syscalls-generic.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_syscalls/syscalls-generic.c 2005-06-12 16:43:33 UTC=
(rev 3899)
+++ trunk/coregrind/m_syscalls/syscalls-generic.c 2005-06-12 17:26:29 UTC=
(rev 3900)
@@ -2250,6 +2250,24 @@
}
}
=20
+static Bool i_am_the_only_thread ( void )
+{
+ Int c =3D VG_(count_living_threads)();
+ vg_assert(c >=3D 1); /* stay sane */
+ return c =3D=3D 1;
+}
+
+/* Wait until all other threads disappear. */
+void VG_(reap_threads)(ThreadId self)
+{
+ while (!i_am_the_only_thread()) {
+ /* Let other thread(s) run */
+ VG_(vg_yield)();
+ VG_(poll_signals)(self);
+ }
+ vg_assert(i_am_the_only_thread());
+}
+
// XXX: prototype here seemingly doesn't match the prototype for i386-li=
nux,
// but it seems to work nonetheless...
PRE(sys_execve)
@@ -2299,7 +2317,7 @@
this. (Really, nuke them all, since the new process will make
its own new thread.) */
VG_(nuke_all_threads_except)( tid, VgSrc_ExitSyscall );
- VGA_(reap_threads)(tid);
+ VG_(reap_threads)(tid);
=20
{ // Remove the valgrind-specific stuff from the environment so the
// child doesn't get vg_inject.so, vgpreload.so, etc. This is
Modified: trunk/coregrind/m_syscalls/syscalls-linux.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_syscalls/syscalls-linux.c 2005-06-12 16:43:33 UTC (=
rev 3899)
+++ trunk/coregrind/m_syscalls/syscalls-linux.c 2005-06-12 17:26:29 UTC (=
rev 3900)
@@ -30,10 +30,12 @@
=20
#include "core.h"
#include "pub_core_aspacemgr.h"
+#include "pub_core_debuglog.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcfile.h"
#include "pub_core_libcprint.h"
+#include "pub_core_libcproc.h"
#include "pub_core_mallocfree.h"
#include "pub_core_tooliface.h"
#include "pub_core_options.h"
@@ -43,6 +45,51 @@
#include "priv_syscalls-generic.h"
#include "priv_syscalls-linux.h"
=20
+// Run a thread from beginning to end and return the thread's
+// scheduler-return-code.
+VgSchedReturnCode VG_(thread_wrapper)(Word /*ThreadId*/ tidW)
+{
+ VG_(debugLog)(1, "core_os",=20
+ "VG_(thread_wrapper)(tid=3D%lld): entry\n",=20
+ (ULong)tidW);
+
+ VgSchedReturnCode ret;
+ ThreadId tid =3D (ThreadId)tidW;
+ ThreadState* tst =3D VG_(get_ThreadState)(tid);
+
+ vg_assert(tst->status =3D=3D VgTs_Init);
+
+ /* make sure we get the CPU lock before doing anything significant */
+ VG_(set_running)(tid);
+
+ if (0)
+ VG_(printf)("thread tid %d started: stack =3D %p\n",
+ tid, &tid);
+
+ VG_TRACK ( post_thread_create, tst->os_state.parent, tid );
+
+ tst->os_state.lwpid =3D VG_(gettid)();
+ tst->os_state.threadgroup =3D VG_(getpid)();
+
+ /* Thread created with all signals blocked; scheduler will set the
+ appropriate mask */
+
+ ret =3D VG_(scheduler)(tid);
+
+ vg_assert(VG_(is_exiting)(tid));
+ =20
+ vg_assert(tst->status =3D=3D VgTs_Runnable);
+ vg_assert(VG_(is_running_thread)(tid));
+
+ VG_(debugLog)(1, "core_os",=20
+ "VG_(thread_wrapper)(tid=3D%lld): done\n",=20
+ (ULong)tidW);
+
+ /* Return to caller, still holding the lock. */
+ return ret;
+}
+
+
/* ---------------------------------------------------------------------
PRE/POST wrappers for arch-generic, Linux-specific syscalls
------------------------------------------------------------------ */
Modified: trunk/coregrind/m_syscalls/syscalls-x86-linux.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_syscalls/syscalls-x86-linux.c 2005-06-12 16:43:33 U=
TC (rev 3899)
+++ trunk/coregrind/m_syscalls/syscalls-x86-linux.c 2005-06-12 17:26:29 U=
TC (rev 3900)
@@ -139,15 +139,15 @@
=20
VG_(debugLog)(1, "syscalls-x86-linux",=20
"run_a_thread_NORETURN(tid=3D%lld): "
- "VGO_(thread_wrapper) called\n",
+ "VG_(thread_wrapper) called\n",
(ULong)tidW);
=20
/* Run the thread all the way through. */
- VgSchedReturnCode src =3D VGO_(thread_wrapper)(tid); =20
+ VgSchedReturnCode src =3D VG_(thread_wrapper)(tid); =20
=20
VG_(debugLog)(1, "syscalls-x86-linux",=20
"run_a_thread_NORETURN(tid=3D%lld): "
- "VGO_(thread_wrapper) done\n",
+ "VG_(thread_wrapper) done\n",
(ULong)tidW);
=20
Int c =3D VG_(count_living_threads)();
Modified: trunk/coregrind/pub_core_syscalls.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_syscalls.h 2005-06-12 16:43:33 UTC (rev 3899=
)
+++ trunk/coregrind/pub_core_syscalls.h 2005-06-12 17:26:29 UTC (rev 3900=
)
@@ -62,6 +62,9 @@
Bool restart
);
=20
+// Wait until all other threads are dead
+extern void VG_(reap_threads)(ThreadId self);
+
// Release resources held by this thread
extern void VGP_(cleanup_thread) ( ThreadArchState* );
=20
|
|
From: <sv...@va...> - 2005-06-12 16:44:24
|
Author: njn
Date: 2005-06-12 17:43:33 +0100 (Sun, 12 Jun 2005)
New Revision: 3899
Log:
Formatting wibble
Modified:
trunk/coregrind/m_libcbase.c
Modified: trunk/coregrind/m_libcbase.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_libcbase.c 2005-06-12 10:23:23 UTC (rev 3898)
+++ trunk/coregrind/m_libcbase.c 2005-06-12 16:43:33 UTC (rev 3899)
@@ -547,21 +547,16 @@
{
SysRes res;
=20
-# if defined(VGP_x86_linux)
+#if defined(VGP_x86_linux)
UInt eax =3D do_syscall_x86_linux_WRK(sysno,a1,a2,a3,a4,a5,a6);
res =3D VG_(mk_SysRes_x86_linux)( eax );
-# else
-
-# if defined(VGP_amd64_linux)
+#elif defined(VGP_amd64_linux)
ULong rax =3D do_syscall_amd64_linux_WRK(sysno,a1,a2,a3,a4,a5,a6);
res =3D VG_(mk_SysRes_amd64_linux)( rax );
-# else
+#else
+# error VG_(do_syscall): unimplemented on this platform
+#endif
=20
-# error VG_(do_syscall): unimplemented on this platform
-
-# endif
-# endif
-
return res;
}
=20
|
|
From: <sv...@va...> - 2005-06-12 10:24:17
|
Author: de Date: 2005-06-12 11:23:23 +0100 (Sun, 12 Jun 2005) New Revision: 3898 Log: mc-tech-docs.xml: - fixed link to comply with house-style mc-manual.xml: - rm'd unhelpful sentence + it's footnote quick-start-guide.xml: - fixed up some section ids + xreflabels=20 so we don't get cool filenames like 'bk01s02.html'. Modified: trunk/docs/xml/quick-start-guide.xml trunk/memcheck/docs/mc-manual.xml trunk/memcheck/docs/mc-tech-docs.xml Modified: trunk/docs/xml/quick-start-guide.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/docs/xml/quick-start-guide.xml 2005-06-12 04:34:51 UTC (rev 389= 7) +++ trunk/docs/xml/quick-start-guide.xml 2005-06-12 10:23:23 UTC (rev 389= 8) @@ -34,14 +34,16 @@ to Valgrind version 2.4.0; some of the information is not quite right f= or earlier versions.</para> =20 -<sect1> +<sect1 id=3D"quick-start.prepare"=20 + xreflabel=3D"Preparing your program"> <title>Preparing your program</title> <para>Compile your program with <computeroutput>-g</computeroutput> to i= nclude debugging information so that Memcheck's error messages include exact li= ne numbers.</para> </sect1> =20 -<sect1> +<sect1 id=3D"quick-start.mcrun"=20 + xreflabel=3D"Running your program under Memcheck"> <title>Running your program under Memcheck</title> <para>If you normally run your program like this: =20 @@ -64,7 +66,8 @@ and leaks that it detects.</para> </sect1> =20 -<sect1> +<sect1 id=3D"quick-start.interpret"=20 + xreflabel=3D"Interpreting Memcheck's output"> <title>Interpreting Memcheck's output</title> <para>Here's an example C program with a memory error and a memory leak. =20 @@ -170,7 +173,7 @@ examples of all the error messages Memcheck produces.</para> </sect1> =20 -<sect1> +<sect1 id=3D"quick-start.caveats" xreflabel=3D"Caveats"> <title>Caveats</title> <para>Memcheck is not perfect; it occasionally produces false positives= , and there are mechanisms for suppressing these (see @@ -184,7 +187,7 @@ allocated statically or on the stack.</para> </sect1> =20 -<sect1> +<sect1 id=3D"quick-start.info" xreflabel=3D"More Information"> <title>More information</title> <para>Please consult the <xref linkend=3D"FAQ"/> and the <xref linkend=3D"manual"/>, which have much more information. Note that= the Modified: trunk/memcheck/docs/mc-manual.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/memcheck/docs/mc-manual.xml 2005-06-12 04:34:51 UTC (rev 3897) +++ trunk/memcheck/docs/mc-manual.xml 2005-06-12 10:23:23 UTC (rev 3898) @@ -396,16 +396,7 @@ before the pointer actually returned. This implies a variable-sized overhead in what's returned by <computeroutput>new</computeroutput> or -<computeroutput>new[]</computeroutput>. It rather surprising how -compilers -<footnote> - <para>[Ed: runtime-support libraries ?]</para> -</footnote> -are robust to mismatch in <computeroutput>new</computeroutput> / -<computeroutput>delete</computeroutput> -<computeroutput>new[]</computeroutput> / -<computeroutput>delete[]</computeroutput>.</para> - +<computeroutput>new[]</computeroutput>. </sect2> =20 =20 Modified: trunk/memcheck/docs/mc-tech-docs.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/memcheck/docs/mc-tech-docs.xml 2005-06-12 04:34:51 UTC (rev 389= 7) +++ trunk/memcheck/docs/mc-tech-docs.xml 2005-06-12 10:23:23 UTC (rev 389= 8) @@ -1534,7 +1534,7 @@ =20 =20 =20 -<sect2 id=3D"mc-manual.trans" xreflabel=3D"Translation into UCode"> +<sect2 id=3D"mc-tech-docs.trans" xreflabel=3D"Translation into UCode"> <title>Translation into UCode</title> =20 <para><computeroutput>VG_(disBB)</computeroutput> allocates a new |
|
From: <sv...@va...> - 2005-06-12 04:34:56
|
Author: njn
Date: 2005-06-12 05:34:51 +0100 (Sun, 12 Jun 2005)
New Revision: 3897
Log:
Move the *ROUND* macros to a better place.
Modified:
trunk/coregrind/stage1.c
trunk/coregrind/ume.c
trunk/include/basic_types.h
trunk/include/pub_tool_libcbase.h
trunk/include/tool.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-06-12 04:19:17 UTC (rev 3896)
+++ trunk/coregrind/stage1.c 2005-06-12 04:34:51 UTC (rev 3897)
@@ -45,6 +45,7 @@
#include "ume.h"
#include "memcheck/memcheck.h"
#include "pub_core_debuglog.h"
+#include "pub_core_libcbase.h"
#include "pub_core_libcproc.h"
=20
=20
Modified: trunk/coregrind/ume.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/ume.c 2005-06-12 04:19:17 UTC (rev 3896)
+++ trunk/coregrind/ume.c 2005-06-12 04:34:51 UTC (rev 3897)
@@ -45,6 +45,7 @@
#include <assert.h>
=20
#include "ume.h"
+#include "pub_core_libcbase.h"
=20
#if ELFSZ =3D=3D 64
#define ESZ(x) Elf64_##x
Modified: trunk/include/basic_types.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/include/basic_types.h 2005-06-12 04:19:17 UTC (rev 3896)
+++ trunk/include/basic_types.h 2005-06-12 04:34:51 UTC (rev 3897)
@@ -69,11 +69,19 @@
non-builtin types
------------------------------------------------------------------ */
=20
+// XXX: these probably shouldn't be here...
+
/* ThreadIds are simply indices into the VG_(threads)[] array. */
typedef
UInt
ThreadId;
=20
+/* Special magic value for an invalid ThreadId. It corresponds to
+ LinuxThreads using zero as the initial value for
+ pthread_mutex_t.__m_owner and pthread_cond_t.__c_waiting. */
+#define VG_INVALID_THREADID ((ThreadId)(0))
+
+
/* An abstraction of syscall return values.
When .isError =3D=3D False, val holds the return value.
When .isError =3D=3D True, val holds the error code.
Modified: trunk/include/pub_tool_libcbase.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/include/pub_tool_libcbase.h 2005-06-12 04:19:17 UTC (rev 3896)
+++ trunk/include/pub_tool_libcbase.h 2005-06-12 04:34:51 UTC (rev 3897)
@@ -96,6 +96,13 @@
#define VG_IS_WORD_ALIGNED(aaa_p) (0 =3D=3D (((Addr)(aaa_p)) & ((Addr)(s=
izeof(Addr)-1))))
#define VG_IS_PAGE_ALIGNED(aaa_p) (0 =3D=3D (((Addr)(aaa_p)) & ((Addr)(V=
KI_PAGE_SIZE-1))))
=20
+// 'a' -- the alignment -- must be a power of 2.
+// The latter two require the vki-*.h header to be imported also.
+#define VG_ROUNDDN(p, a) ((Addr)(p) & ~((Addr)(a)-1))
+#define VG_ROUNDUP(p, a) VG_ROUNDDN((p)+(a)-1, (a))
+#define VG_PGROUNDDN(p) VG_ROUNDDN(p, VKI_PAGE_SIZE)
+#define VG_PGROUNDUP(p) VG_ROUNDUP(p, VKI_PAGE_SIZE)
+
/* ---------------------------------------------------------------------
Misc useful functions
------------------------------------------------------------------ */
Modified: trunk/include/tool.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/include/tool.h 2005-06-12 04:19:17 UTC (rev 3896)
+++ trunk/include/tool.h 2005-06-12 04:34:51 UTC (rev 3897)
@@ -57,12 +57,6 @@
/*=3D=3D=3D Useful macros =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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
-// 'a' -- the alignment -- must be a power of 2
-#define VG_ROUNDDN(p, a) ((Addr)(p) & ~((Addr)(a)-1))
-#define VG_ROUNDUP(p, a) VG_ROUNDDN((p)+(a)-1, (a))
-#define VG_PGROUNDDN(p) VG_ROUNDDN(p, VKI_PAGE_SIZE)
-#define VG_PGROUNDUP(p) VG_ROUNDUP(p, VKI_PAGE_SIZE)
-
/* Path to all our library/aux files */
extern const Char *VG_(libdir);
=20
@@ -73,11 +67,6 @@
/* ------------------------------------------------------------------ */
/* Thread-related stuff */
=20
-/* Special magic value for an invalid ThreadId. It corresponds to
- LinuxThreads using zero as the initial value for
- pthread_mutex_t.__m_owner and pthread_cond_t.__c_waiting. */
-#define VG_INVALID_THREADID ((ThreadId)(0))
-
/* Get the TID of the thread which currently has the CPU. */
extern ThreadId VG_(get_running_tid) ( void );
=20
|
|
From: <sv...@va...> - 2005-06-12 04:20:12
|
Author: njn
Date: 2005-06-12 05:19:17 +0100 (Sun, 12 Jun 2005)
New Revision: 3896
Log:
Moved more stuff out of core_os.c into better places.
Modified:
trunk/coregrind/core.h
trunk/coregrind/linux/core_os.c
trunk/coregrind/m_main.c
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/pub_core_main.h
Modified: trunk/coregrind/core.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/core.h 2005-06-12 02:49:35 UTC (rev 3895)
+++ trunk/coregrind/core.h 2005-06-12 04:19:17 UTC (rev 3896)
@@ -163,21 +163,12 @@
// wait until all other threads are dead
extern void VGA_(reap_threads)(ThreadId self);
=20
-// handle an arch-specific client request
-extern Bool VGA_(client_request)(ThreadId tid, UWord *args);
-
// For attaching the debugger
extern Int VGA_(ptrace_setregs_from_tst) ( Int pid, ThreadArchState* ar=
ch );
=20
// Used by leakcheck
extern void VGA_(mark_from_registers)(ThreadId tid, void (*marker)(Addr)=
);
=20
-// Set up the libc freeres wrapper
-extern void VGA_(intercept_libc_freeres_wrapper)(Addr);
-
-// Clean up the client by calling before the final reports
-extern void VGA_(final_tidyup)(ThreadId tid);
-
/* ---------------------------------------------------------------------
Finally - autoconf-generated settings
------------------------------------------------------------------ */
Modified: trunk/coregrind/linux/core_os.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/linux/core_os.c 2005-06-12 02:49:35 UTC (rev 3895)
+++ trunk/coregrind/linux/core_os.c 2005-06-12 04:19:17 UTC (rev 3896)
@@ -103,84 +103,6 @@
vg_assert(i_am_the_only_thread());
}
=20
-/* The we need to know the address of it so it can be
- called at program exit. */
-static Addr __libc_freeres_wrapper;
-
-void VGA_(intercept_libc_freeres_wrapper)(Addr addr)
-{
- __libc_freeres_wrapper =3D addr;
-}
-
-/* Final clean-up before terminating the process. =20
- Clean up the client by calling __libc_freeres() (if requested) */
-void VGA_(final_tidyup)(ThreadId tid)
-{
- vg_assert(VG_(is_running_thread)(tid));
- =20
- if (!VG_(needs).libc_freeres ||
- !VG_(clo_run_libc_freeres) ||
- __libc_freeres_wrapper =3D=3D 0)
- return; /* can't/won't do it */
-
- if (VG_(clo_verbosity) > 2 ||
- VG_(clo_trace_syscalls) ||
- VG_(clo_trace_sched))
- VG_(message)(Vg_DebugMsg,=20
- "Caught __NR_exit; running __libc_freeres()");
- =20
- /* point thread context to point to libc_freeres_wrapper */
- INSTR_PTR(VG_(threads)[tid].arch) =3D __libc_freeres_wrapper;
- // XXX should we use a special stack?
-
- /* Block all blockable signals by copying the real block state into
- the thread's block state*/
- VG_(sigprocmask)(VKI_SIG_BLOCK, NULL, &VG_(threads)[tid].sig_mask);
- VG_(threads)[tid].tmp_sig_mask =3D VG_(threads)[tid].sig_mask;
-
- /* and restore handlers to default */
- VG_(set_default_handler)(VKI_SIGSEGV);
- VG_(set_default_handler)(VKI_SIGBUS);
- VG_(set_default_handler)(VKI_SIGILL);
- VG_(set_default_handler)(VKI_SIGFPE);
-
- // We were exiting, so assert that...
- vg_assert(VG_(is_exiting)(tid));
- // ...but now we're not again
- VG_(threads)[tid].exitreason =3D VgSrc_None;
-
- // run until client thread exits - ideally with LIBC_FREERES_DONE,
- // but exit/exitgroup/signal will do
- VG_(scheduler)(tid);
-
- vg_assert(VG_(is_exiting)(tid));
-}
-
-// Arch-specific client requests
-Bool VGA_(client_request)(ThreadId tid, UWord *args)
-{
- Bool handled =3D True;
-
- vg_assert(VG_(is_running_thread)(tid));
-
- switch(args[0]) {
- case VG_USERREQ__LIBC_FREERES_DONE:
- /* This is equivalent to an exit() syscall, but we don't set the
- exitcode (since it might already be set) */
- if (0 || VG_(clo_trace_syscalls) || VG_(clo_trace_sched))
- VG_(message)(Vg_DebugMsg,=20
- "__libc_freeres() done; really quitting!");
- VG_(threads)[tid].exitreason =3D VgSrc_ExitSyscall;
- break;
-
- default:
- handled =3D False;
- break;
- }
-
- return handled;
-}
-
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_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/m_main.c 2005-06-12 02:49:35 UTC (rev 3895)
+++ trunk/coregrind/m_main.c 2005-06-12 04:19:17 UTC (rev 3896)
@@ -2802,6 +2802,61 @@
}
=20
=20
+/* The we need to know the address of it so it can be
+ called at program exit. */
+static Addr __libc_freeres_wrapper;
+
+void VGA_(intercept_libc_freeres_wrapper)(Addr addr)
+{
+ __libc_freeres_wrapper =3D addr;
+}
+
+/* Final clean-up before terminating the process. =20
+ Clean up the client by calling __libc_freeres() (if requested)=20
+ This is Linux-specific?
+*/
+static void final_tidyup(ThreadId tid)
+{
+ vg_assert(VG_(is_running_thread)(tid));
+ =20
+ if (!VG_(needs).libc_freeres ||
+ !VG_(clo_run_libc_freeres) ||
+ __libc_freeres_wrapper =3D=3D 0)
+ return; /* can't/won't do it */
+
+ if (VG_(clo_verbosity) > 2 ||
+ VG_(clo_trace_syscalls) ||
+ VG_(clo_trace_sched))
+ VG_(message)(Vg_DebugMsg,=20
+ "Caught __NR_exit; running __libc_freeres()");
+ =20
+ /* point thread context to point to libc_freeres_wrapper */
+ INSTR_PTR(VG_(threads)[tid].arch) =3D __libc_freeres_wrapper;
+ // XXX should we use a special stack?
+
+ /* Block all blockable signals by copying the real block state into
+ the thread's block state*/
+ VG_(sigprocmask)(VKI_SIG_BLOCK, NULL, &VG_(threads)[tid].sig_mask);
+ VG_(threads)[tid].tmp_sig_mask =3D VG_(threads)[tid].sig_mask;
+
+ /* and restore handlers to default */
+ VG_(set_default_handler)(VKI_SIGSEGV);
+ VG_(set_default_handler)(VKI_SIGBUS);
+ VG_(set_default_handler)(VKI_SIGILL);
+ VG_(set_default_handler)(VKI_SIGFPE);
+
+ // We were exiting, so assert that...
+ vg_assert(VG_(is_exiting)(tid));
+ // ...but now we're not again
+ VG_(threads)[tid].exitreason =3D VgSrc_None;
+
+ // run until client thread exits - ideally with LIBC_FREERES_DONE,
+ // but exit/exitgroup/signal will do
+ VG_(scheduler)(tid);
+
+ vg_assert(VG_(is_exiting)(tid));
+}
+
/* Do everything which needs doing when the last thread exits */
void VG_(shutdown_actions_NORETURN) ( ThreadId tid,=20
VgSchedReturnCode tids_schedretcod=
e )
@@ -2817,7 +2872,7 @@
VG_(clo_model_pthreads) =3D False;
=20
// Clean the client up before the final report
- VGA_(final_tidyup)(tid);
+ final_tidyup(tid);
=20
// OK, done
VG_(exit_thread)(tid);
Modified: trunk/coregrind/m_scheduler/scheduler.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_scheduler/scheduler.c 2005-06-12 02:49:35 UTC (rev =
3895)
+++ trunk/coregrind/m_scheduler/scheduler.c 2005-06-12 04:19:17 UTC (rev =
3896)
@@ -983,6 +983,32 @@
Handle client requests.
------------------------------------------------------------------ */
=20
+// OS-specific(?) client requests
+static Bool os_client_request(ThreadId tid, UWord *args)
+{
+ Bool handled =3D True;
+
+ vg_assert(VG_(is_running_thread)(tid));
+
+ switch(args[0]) {
+ case VG_USERREQ__LIBC_FREERES_DONE:
+ /* This is equivalent to an exit() syscall, but we don't set the
+ exitcode (since it might already be set) */
+ if (0 || VG_(clo_trace_syscalls) || VG_(clo_trace_sched))
+ VG_(message)(Vg_DebugMsg,=20
+ "__libc_freeres() done; really quitting!");
+ VG_(threads)[tid].exitreason =3D VgSrc_ExitSyscall;
+ break;
+
+ default:
+ handled =3D False;
+ break;
+ }
+
+ return handled;
+}
+
+
/* Do a client request for the thread tid. After the request, tid may
or may not still be runnable; if not, the scheduler will have to
choose a new thread to run. =20
@@ -1109,8 +1135,8 @@
break;
=20
default:
- if (VGA_(client_request)(tid, arg)) {
- /* architecture handled the client request */
+ if (os_client_request(tid, arg)) {
+ // do nothing, os_client_request() handled it
} else if (VG_(needs).client_requests) {
UWord ret;
=20
Modified: trunk/coregrind/pub_core_main.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_main.h 2005-06-12 02:49:35 UTC (rev 3895)
+++ trunk/coregrind/pub_core_main.h 2005-06-12 04:19:17 UTC (rev 3896)
@@ -54,6 +54,8 @@
/* 64-bit counter for the number of basic blocks done. */
extern ULong VG_(bbs_done);
=20
+// Set up the libc freeres wrapper (XXX: currently unused -- ?!)
+extern void VGA_(intercept_libc_freeres_wrapper)(Addr);
=20
#endif // __PUB_CORE_MAIN_H
=20
|
|
From: Tom H. <th...@cy...> - 2005-06-12 03:04:36
|
Nightly build on audi ( i686, Red Hat 9 ) started at 2005-06-12 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 == 176 tests, 8 stderr failures, 1 stdout failure ================= memcheck/tests/sigaltstack (stderr) memcheck/tests/xml1 (stderr) corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/pth_cancel1 (stdout) corecheck/tests/pth_cancel1 (stderr) corecheck/tests/pth_cancel2 (stderr) none/tests/faultstatus (stderr) none/tests/pth_blockedsig (stderr) none/tests/x86/int (stderr) |
|
From: <js...@ac...> - 2005-06-12 02:50:03
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-06-12 03:50:00 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow Nightly build on phoenix ( SuSE 9.1 ) started at 2005-06-12 03:50:00 BST |
|
From: <sv...@va...> - 2005-06-12 02:49:37
|
Author: njn
Date: 2005-06-12 03:49:35 +0100 (Sun, 12 Jun 2005)
New Revision: 3895
Log:
Move VG_(fcntl) into m_libcfile.
Modified:
trunk/coregrind/core.h
trunk/coregrind/m_libcfile.c
trunk/coregrind/m_libcproc.c
trunk/coregrind/pub_core_libcfile.h
Modified: trunk/coregrind/core.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/core.h 2005-06-12 02:43:17 UTC (rev 3894)
+++ trunk/coregrind/core.h 2005-06-12 02:49:35 UTC (rev 3895)
@@ -111,14 +111,7 @@
#define VG_WRAPPER(name) _vgw_##name
#define VG_WRAPPER_ALIAS(name) "_vgw_" #name
=20
-
/* ---------------------------------------------------------------------
- Exports of vg_mylibc.c
- ------------------------------------------------------------------ */
-
-extern Int VG_(fcntl) ( Int fd, Int cmd, Int arg );
-
-/* ---------------------------------------------------------------------
Exports of vg_syscall.S
------------------------------------------------------------------ */
=20
Modified: trunk/coregrind/m_libcfile.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_libcfile.c 2005-06-12 02:43:17 UTC (rev 3894)
+++ trunk/coregrind/m_libcfile.c 2005-06-12 02:49:35 UTC (rev 3895)
@@ -122,6 +122,13 @@
return res.isError ? (-1) : res.val;
}
=20
+/* Returns -1 on error. */
+Int VG_(fcntl) ( Int fd, Int cmd, Int arg )
+{
+ SysRes res =3D VG_(do_syscall3)(__NR_fcntl, fd, cmd, arg);
+ return res.isError ? -1 : res.val;
+}
+
Int VG_(rename) ( Char* old_name, Char* new_name )
{
SysRes res =3D VG_(do_syscall2)(__NR_rename, (UWord)old_name, (UWord)=
new_name);
Modified: trunk/coregrind/m_libcproc.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_libcproc.c 2005-06-12 02:43:17 UTC (rev 3894)
+++ trunk/coregrind/m_libcproc.c 2005-06-12 02:49:35 UTC (rev 3895)
@@ -224,13 +224,6 @@
return res.isError ? -1 : res.val;
}
=20
-/* Returns -1 on error. */
-Int VG_(fcntl) ( Int fd, Int cmd, Int arg )
-{
- SysRes res =3D VG_(do_syscall3)(__NR_fcntl, fd, cmd, arg);
- return res.isError ? -1 : res.val;
-}
-
Int VG_(poll)( struct vki_pollfd *ufds, UInt nfds, Int timeout)
{
SysRes res =3D VG_(do_syscall3)(__NR_poll, (UWord)ufds, nfds, timeout=
);
Modified: trunk/coregrind/pub_core_libcfile.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_libcfile.h 2005-06-12 02:43:17 UTC (rev 3894=
)
+++ trunk/coregrind/pub_core_libcfile.h 2005-06-12 02:49:35 UTC (rev 3895=
)
@@ -43,7 +43,8 @@
extern Int VG_(fd_hard_limit);
=20
/* Move an fd into the Valgrind-safe range */
-extern Int VG_(safe_fd)(Int oldfd);
+extern Int VG_(safe_fd) ( Int oldfd );
+extern Int VG_(fcntl) ( Int fd, Int cmd, Int arg );
=20
extern Int VG_(write_socket)( Int sd, void *msg, Int count );
extern Int VG_(connect_via_socket)( UChar* str );
|
Author: njn Date: 2005-06-12 03:43:17 +0100 (Sun, 12 Jun 2005) New Revision: 3894 Log: Finished the modularisation of vg_mylibc.c, which meant it could be remov= ed. Added: trunk/coregrind/m_libcproc.c trunk/coregrind/pub_core_libcproc.h trunk/include/pub_tool_libcproc.h Removed: trunk/coregrind/vg_mylibc.c Modified: trunk/cachegrind/cg-amd64.c trunk/cachegrind/cg-x86.c trunk/cachegrind/cg_main.c trunk/coregrind/Makefile.am trunk/coregrind/core.h trunk/coregrind/linux/core_os.c trunk/coregrind/m_aspacemgr/aspacemgr.c trunk/coregrind/m_errormgr.c trunk/coregrind/m_libcassert.c trunk/coregrind/m_libcmman.c trunk/coregrind/m_libcprint.c trunk/coregrind/m_main.c trunk/coregrind/m_scheduler/scheduler.c trunk/coregrind/m_scheduler/sema.c trunk/coregrind/m_signals.c trunk/coregrind/m_syscalls/syscalls-amd64-linux.c trunk/coregrind/m_syscalls/syscalls-generic.c trunk/coregrind/m_syscalls/syscalls-main.c trunk/coregrind/m_syscalls/syscalls-x86-linux.c trunk/coregrind/m_tooliface.c trunk/coregrind/pub_core_main.h trunk/coregrind/pub_core_options.h trunk/coregrind/stage1.c trunk/helgrind/hg_main.c trunk/include/Makefile.am trunk/include/pub_tool_libcassert.h trunk/include/tool.h trunk/lackey/lk_main.c trunk/massif/ms_main.c Modified: trunk/cachegrind/cg-amd64.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/cachegrind/cg-amd64.c 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/cachegrind/cg-amd64.c 2005-06-12 02:43:17 UTC (rev 3894) @@ -31,6 +31,7 @@ #include "tool.h" #include "cg_arch.h" #include "pub_tool_libcbase.h" +#include "pub_tool_libcassert.h" #include "pub_tool_libcprint.h" =20 // All CPUID info taken from sandpile.org/a32/cpuid.htm */ Modified: trunk/cachegrind/cg-x86.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/cachegrind/cg-x86.c 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/cachegrind/cg-x86.c 2005-06-12 02:43:17 UTC (rev 3894) @@ -30,6 +30,7 @@ =20 #include "tool.h" #include "pub_tool_libcbase.h" +#include "pub_tool_libcassert.h" #include "pub_tool_libcprint.h" #include "cg_arch.h" =20 Modified: trunk/cachegrind/cg_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/cachegrind/cg_main.c 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/cachegrind/cg_main.c 2005-06-12 02:43:17 UTC (rev 3894) @@ -36,6 +36,7 @@ #include "pub_tool_libcassert.h" #include "pub_tool_libcfile.h" #include "pub_tool_libcprint.h" +#include "pub_tool_libcproc.h" #include "pub_tool_mallocfree.h" #include "pub_tool_options.h" #include "pub_tool_profile.h" 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-06-12 00:06:24 UTC (rev 3893) +++ trunk/coregrind/Makefile.am 2005-06-12 02:43:17 UTC (rev 3894) @@ -51,6 +51,7 @@ pub_core_libcfile.h \ pub_core_libcmman.h \ pub_core_libcprint.h \ + pub_core_libcproc.h \ pub_core_libcsignal.h \ pub_core_main.h \ pub_core_mallocfree.h \ @@ -100,6 +101,7 @@ m_libcfile.c \ m_libcmman.c \ m_libcprint.c \ + m_libcproc.c \ m_libcsignal.c \ m_main.c \ m_mallocfree.c \ @@ -115,8 +117,7 @@ m_translate.c \ m_transtab.c \ \ - ume.c \ - vg_mylibc.c + ume.c =20 ## Nb: libscheduler.a must precede libdispatch.a in this list. stage2_extra=3D \ Modified: trunk/coregrind/core.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/core.h 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/coregrind/core.h 2005-06-12 02:43:17 UTC (rev 3894) @@ -82,13 +82,6 @@ #include "pub_core_scheduler.h" // for types 'ThreadArchState' =20 /* --------------------------------------------------------------------- - Environment variables - ------------------------------------------------------------------ */ - -/* The directory we look for all our auxillary files in */ -#define VALGRINDLIB "VALGRINDLIB" - -/* --------------------------------------------------------------------- Exports of vg_intercept.c ------------------------------------------------------------------ */ =20 @@ -124,26 +117,7 @@ ------------------------------------------------------------------ */ =20 extern Int VG_(fcntl) ( Int fd, Int cmd, Int arg ); -extern Int VG_(poll)( struct vki_pollfd *, UInt nfds, Int timeout); =20 -/* Environment manipulations */ -extern Char **VG_(env_setenv) ( Char ***envp, const Char* varname, - const Char *val ); -extern void VG_(env_unsetenv) ( Char **env, const Char *varname ); -extern void VG_(env_remove_valgrind_env_stuff) ( Char** env );=20 - -extern void VG_(nanosleep)(struct vki_timespec *); - -/* Simple Valgrind-internal atfork mechanism */ -/* Internal atfork handlers */ -typedef void (*vg_atfork_t)(ThreadId); -extern void VG_(atfork)(vg_atfork_t pre, vg_atfork_t parent,=20 - vg_atfork_t child); -extern void VG_(do_atfork_pre) (ThreadId tid); -extern void VG_(do_atfork_parent)(ThreadId tid); -extern void VG_(do_atfork_child) (ThreadId tid); - - /* --------------------------------------------------------------------- Exports of vg_syscall.S ------------------------------------------------------------------ */ Modified: trunk/coregrind/linux/core_os.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/linux/core_os.c 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/coregrind/linux/core_os.c 2005-06-12 02:43:17 UTC (rev 3894) @@ -33,6 +33,7 @@ #include "pub_core_debuglog.h" #include "pub_core_libcassert.h" #include "pub_core_libcprint.h" +#include "pub_core_libcproc.h" #include "pub_core_libcsignal.h" #include "pub_core_options.h" #include "pub_core_signals.h" Modified: trunk/coregrind/m_aspacemgr/aspacemgr.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_aspacemgr/aspacemgr.c 2005-06-12 00:06:24 UTC (rev = 3893) +++ trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-06-12 02:43:17 UTC (rev = 3894) @@ -37,6 +37,7 @@ #include "pub_core_libcfile.h" // For VG_(fstat)() #include "pub_core_libcmman.h" #include "pub_core_libcprint.h" +#include "pub_core_libcproc.h" #include "pub_core_mallocfree.h" #include "pub_core_options.h" #include "pub_core_syscalls.h" Modified: trunk/coregrind/m_errormgr.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_errormgr.c 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/coregrind/m_errormgr.c 2005-06-12 02:43:17 UTC (rev 3894) @@ -36,6 +36,7 @@ #include "pub_core_libcassert.h" #include "pub_core_libcfile.h" #include "pub_core_libcprint.h" +#include "pub_core_libcproc.h" #include "pub_core_main.h" // for VG_(start_debugger)() #include "pub_core_mallocfree.h" #include "pub_core_options.h" Modified: trunk/coregrind/m_libcassert.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_libcassert.c 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/coregrind/m_libcassert.c 2005-06-12 02:43:17 UTC (rev 3894) @@ -32,9 +32,11 @@ #include "pub_core_libcbase.h" #include "pub_core_libcassert.h" #include "pub_core_libcprint.h" +#include "pub_core_libcproc.h" #include "pub_core_main.h" #include "pub_core_stacktrace.h" #include "pub_core_tooliface.h" +#include "vki_unistd.h" =20 /* --------------------------------------------------------------------- Assertery. @@ -56,6 +58,17 @@ # error Unknown platform #endif =20 +/* Pull down the entire world */ +void VG_(exit)( Int status ) +{ + (void)VG_(do_syscall1)(__NR_exit_group, status ); + (void)VG_(do_syscall1)(__NR_exit, status ); + /* Why are we still alive here? */ + /*NOTREACHED*/ + *(volatile Int *)0 =3D 'x'; + vg_assert(2+2 =3D=3D 5); +} + __attribute__ ((noreturn)) static void report_and_quit ( const Char* report, Addr ip, Addr sp, Addr= fp ) { Modified: trunk/coregrind/m_libcmman.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_libcmman.c 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/coregrind/m_libcmman.c 2005-06-12 02:43:17 UTC (rev 3894) @@ -34,6 +34,7 @@ #include "pub_core_libcassert.h" #include "pub_core_libcmman.h" #include "pub_core_libcprint.h" +#include "pub_core_libcproc.h" #include "vki_unistd.h" =20 SysRes VG_(mmap_native)(void *start, SizeT length, UInt prot, UInt flags= , Modified: trunk/coregrind/m_libcprint.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_libcprint.c 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/coregrind/m_libcprint.c 2005-06-12 02:43:17 UTC (rev 3894) @@ -34,6 +34,7 @@ #include "pub_core_libcassert.h" #include "pub_core_libcfile.h" #include "pub_core_libcprint.h" +#include "pub_core_libcproc.h" #include "pub_core_options.h" #include "valgrind.h" // for RUNNING_ON_VALGRIND =20 Added: trunk/coregrind/m_libcproc.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_libcproc.c 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/coregrind/m_libcproc.c 2005-06-12 02:43:17 UTC (rev 3894) @@ -0,0 +1,490 @@ + +/*--------------------------------------------------------------------*/ +/*--- Process-related libc stuff. m_libcproc.c ---*/ +/*--------------------------------------------------------------------*/ +=20 +/* + 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. +*/ + +#include "core.h" +#include "pub_core_libcbase.h" +#include "pub_core_libcassert.h" +#include "pub_core_libcprint.h" +#include "pub_core_libcproc.h" +#include "pub_core_mallocfree.h" +#include "vki_unistd.h" + +/* --------------------------------------------------------------------- + Command line and environment stuff + ------------------------------------------------------------------ */ + +/* As deduced from sp_at_startup, the client's argc, argv[] and + envp[] as extracted from the client's stack at startup-time. */ +Int VG_(client_argc); +Char** VG_(client_argv); +Char** VG_(client_envp); + +/* We do getenv without libc's help by snooping around in + VG_(client_envp) as determined at startup time. */ +Char *VG_(getenv)(Char *varname) +{ + Int i, n; + n =3D VG_(strlen)(varname); + for (i =3D 0; VG_(client_envp)[i] !=3D NULL; i++) { + Char* s =3D VG_(client_envp)[i]; + if (VG_(strncmp)(varname, s, n) =3D=3D 0 && s[n] =3D=3D '=3D') { + return & s[n+1]; + } + } + return NULL; +} + +void VG_(env_unsetenv) ( Char **env, const Char *varname ) +{ + Char **from; + Char **to =3D NULL; + Int len =3D VG_(strlen)(varname); + + for(from =3D to =3D env; from && *from; from++) { + if (!(VG_(strncmp)(varname, *from, len) =3D=3D 0 && (*from)[len] =3D= =3D '=3D')) { + *to =3D *from; + to++; + } + } + *to =3D *from; +} + +/* set the environment; returns the old env if a new one was allocated *= / +Char **VG_(env_setenv) ( Char ***envp, const Char* varname, const Char *= val ) +{ + Char **env =3D (*envp); + Char **cpp; + Int len =3D VG_(strlen)(varname); + Char *valstr =3D VG_(arena_malloc)(VG_AR_CORE, len + VG_(strlen)(val)= + 2); + Char **oldenv =3D NULL; + + VG_(sprintf)(valstr, "%s=3D%s", varname, val); + + for(cpp =3D env; cpp && *cpp; cpp++) { + if (VG_(strncmp)(varname, *cpp, len) =3D=3D 0 && (*cpp)[len] =3D=3D= '=3D') { + *cpp =3D valstr; + return oldenv; + } + } + + if (env =3D=3D NULL) { + env =3D VG_(arena_malloc)(VG_AR_CORE, sizeof(Char **) * 2); + env[0] =3D valstr; + env[1] =3D NULL; + + *envp =3D env; + + } else { + Int envlen =3D (cpp-env) + 2; + Char **newenv =3D VG_(arena_malloc)(VG_AR_CORE, envlen * sizeof(Ch= ar **)); + + for(cpp =3D newenv; *env; ) + *cpp++ =3D *env++; + *cpp++ =3D valstr; + *cpp++ =3D NULL; + + oldenv =3D *envp; + + *envp =3D newenv; + } + + return oldenv; +} + +/* Walk through a colon-separated environment variable, and remove the + entries which match remove_pattern. It slides everything down over + the removed entries, and pads the remaining space with '\0'. It + modifies the entries in place (in the client address space), but it + shouldn't matter too much, since we only do this just before an + execve(). + + This is also careful to mop up any excess ':'s, since empty strings + delimited by ':' are considered to be '.' in a path. +*/ +static void mash_colon_env(Char *varp, const Char *remove_pattern) +{ + Char *const start =3D varp; + Char *entry_start =3D varp; + Char *output =3D varp; + + if (varp =3D=3D NULL) + return; + + while(*varp) { + if (*varp =3D=3D ':') { + Char prev; + Bool match; + + /* This is a bit subtle: we want to match against the entry + we just copied, because it may have overlapped with + itself, junking the original. */ + + prev =3D *output; + *output =3D '\0'; + + match =3D VG_(string_match)(remove_pattern, entry_start); + + *output =3D prev; + =20 + if (match) { + output =3D entry_start; + varp++; /* skip ':' after removed entry */ + } else + entry_start =3D output+1; /* entry starts after ':' */ + } + + *output++ =3D *varp++; + } + + /* match against the last entry */ + if (VG_(string_match)(remove_pattern, entry_start)) { + output =3D entry_start; + if (output > start) { + /* remove trailing ':' */ + output--; + vg_assert(*output =3D=3D ':'); + } + } =20 + + /* pad out the left-overs with '\0' */ + while(output < varp) + *output++ =3D '\0'; +} + + +// Removes all the Valgrind-added stuff from the passed environment. Us= ed +// when starting child processes, so they don't see that added stuff. +void VG_(env_remove_valgrind_env_stuff)(Char** envp) +{ + Int i; + Char* ld_preload_str =3D NULL; + Char* ld_library_path_str =3D NULL; + Char* buf; + + // Find LD_* variables + for (i =3D 0; envp[i] !=3D NULL; i++) { + if (VG_(strncmp)(envp[i], "LD_PRELOAD=3D", 11) =3D=3D 0) + ld_preload_str =3D &envp[i][11]; + if (VG_(strncmp)(envp[i], "LD_LIBRARY_PATH=3D", 16) =3D=3D 0) + ld_library_path_str =3D &envp[i][16]; + } + + buf =3D VG_(arena_malloc)(VG_AR_CORE, VG_(strlen)(VG_(libdir)) + 20); + + // Remove Valgrind-specific entries from LD_*. + VG_(sprintf)(buf, "%s*/vg_inject.so", VG_(libdir)); + mash_colon_env(ld_preload_str, buf); + VG_(sprintf)(buf, "%s*/vgpreload_*.so", VG_(libdir)); + mash_colon_env(ld_preload_str, buf); + VG_(sprintf)(buf, "%s*", VG_(libdir)); + mash_colon_env(ld_library_path_str, buf); + + // Remove VALGRIND_CLO variable. + VG_(env_unsetenv)(envp, VALGRINDCLO); + + // XXX if variable becomes empty, remove it completely? + + VG_(arena_free)(VG_AR_CORE, buf); +} + +/* --------------------------------------------------------------------- + Various important syscall wrappers + ------------------------------------------------------------------ */ + +Int VG_(waitpid)(Int pid, Int *status, Int options) +{ + SysRes res =3D VG_(do_syscall4)(__NR_wait4, pid, (UWord)status, optio= ns, 0); + return res.isError ? -1 : res.val; +} + +/* Returns -1 on error. */ +Int VG_(fcntl) ( Int fd, Int cmd, Int arg ) +{ + SysRes res =3D VG_(do_syscall3)(__NR_fcntl, fd, cmd, arg); + return res.isError ? -1 : res.val; +} + +Int VG_(poll)( struct vki_pollfd *ufds, UInt nfds, Int timeout) +{ + SysRes res =3D VG_(do_syscall3)(__NR_poll, (UWord)ufds, nfds, timeout= ); + /* ASSUMES SYSCALL ALWAYS SUCCEEDS */ + return res.val; +} + +/* clone the environment */ +static Char **env_clone ( Char **oldenv ) +{ + Char **oldenvp; + Char **newenvp; + Char **newenv; + Int envlen; + + for (oldenvp =3D oldenv; oldenvp && *oldenvp; oldenvp++); + + envlen =3D oldenvp - oldenv + 1; + =20 + newenv =3D VG_(arena_malloc)(VG_AR_CORE, envlen * sizeof(Char **)); + + oldenvp =3D oldenv; + newenvp =3D newenv; + =20 + while (oldenvp && *oldenvp) { + *newenvp++ =3D *oldenvp++; + } + =20 + *newenvp =3D *oldenvp; + + return newenv; +} + +/* Return -1 if error, else 0. NOTE does not indicate return code of + child! */ +Int VG_(system) ( Char* cmd ) +{ + Int pid; + SysRes res; + if (cmd =3D=3D NULL) + return 1; + res =3D VG_(do_syscall0)(__NR_fork); + if (res.isError) + return -1; + pid =3D res.val; + if (pid =3D=3D 0) { + /* child */ + static Char** envp =3D NULL; + Char* argv[4]; + + /* restore the DATA rlimit for the child */ + VG_(setrlimit)(VKI_RLIMIT_DATA, &VG_(client_rlimit_data)); + + envp =3D env_clone(VG_(client_envp)); + VG_(env_remove_valgrind_env_stuff)( envp );=20 + + argv[0] =3D "/bin/sh"; + argv[1] =3D "-c"; + argv[2] =3D cmd; + argv[3] =3D 0; + + (void)VG_(do_syscall3)(__NR_execve,=20 + (UWord)"/bin/sh", (UWord)argv, (UWord)envp)= ; + + /* If we're still alive here, execve failed. */ + VG_(exit)(1); + } else { + /* parent */ + Int zzz =3D VG_(waitpid)(pid, NULL, 0); + return zzz =3D=3D -1 ? -1 : 0; + } +} + +/* --------------------------------------------------------------------- + Resource limits + ------------------------------------------------------------------ */ + +struct vki_rlimit VG_(client_rlimit_data); +struct vki_rlimit VG_(client_rlimit_stack); + +/* Support for getrlimit. */ +Int VG_(getrlimit) (Int resource, struct vki_rlimit *rlim) +{ + SysRes res =3D VG_(mk_SysRes_Error)(VKI_ENOSYS); + /* res =3D getrlimit( resource, rlim ); */ +# ifdef __NR_ugetrlimit + res =3D VG_(do_syscall2)(__NR_ugetrlimit, resource, (UWord)rlim); +# endif + if (res.isError && res.val =3D=3D VKI_ENOSYS) + res =3D VG_(do_syscall2)(__NR_getrlimit, resource, (UWord)rlim); + return res.isError ? -1 : res.val; +} + + +/* Support for setrlimit. */ +Int VG_(setrlimit) (Int resource, const struct vki_rlimit *rlim) +{ + SysRes res; + /* res =3D setrlimit( resource, rlim ); */ + res =3D VG_(do_syscall2)(__NR_setrlimit, resource, (UWord)rlim); + return res.isError ? -1 : res.val; +} + +/* --------------------------------------------------------------------- + pids, etc + ------------------------------------------------------------------ */ + +Int VG_(gettid)(void) +{ + SysRes res =3D VG_(do_syscall0)(__NR_gettid); + + if (res.isError && res.val =3D=3D VKI_ENOSYS) { + Char pid[16]; =20 + /* + * The gettid system call does not exist. The obvious assumption + * to make at this point would be that we are running on an older + * system where the getpid system call actually returns the ID of + * the current thread. + * + * Unfortunately it seems that there are some systems with a kerne= l + * where getpid has been changed to return the ID of the thread gr= oup + * leader but where the gettid system call has not yet been added. + * + * So instead of calling getpid here we use readlink to see where + * the /proc/self link is pointing... + */ + + res =3D VG_(do_syscall3)(__NR_readlink, (UWord)"/proc/self", + (UWord)pid, sizeof(pid)); + if (!res.isError && res.val > 0) { + pid[res.val] =3D '\0'; + res.val =3D VG_(atoll)(pid); + } + } + + return res.val; +} + +/* You'd be amazed how many places need to know the current pid. */ +Int VG_(getpid) ( void ) +{ + /* ASSUMES SYSCALL ALWAYS SUCCEEDS */ + return VG_(do_syscall0)(__NR_getpid) . val; +} + +Int VG_(getpgrp) ( void ) +{ + /* ASSUMES SYSCALL ALWAYS SUCCEEDS */ + return VG_(do_syscall0)(__NR_getpgrp) . val; +} + +Int VG_(getppid) ( void ) +{ + /* ASSUMES SYSCALL ALWAYS SUCCEEDS */ + return VG_(do_syscall0)(__NR_getppid) . val; +} + +Int VG_(setpgid) ( Int pid, Int pgrp ) +{ + /* ASSUMES SYSCALL ALWAYS SUCCEEDS */ + return VG_(do_syscall2)(__NR_setpgid, pid, pgrp) . val; +} + +/* --------------------------------------------------------------------- + Timing stuff + ------------------------------------------------------------------ */ + +UInt VG_(read_millisecond_timer) ( void ) +{ + static ULong base =3D 0; + struct vki_timeval tv_now; + ULong now; + SysRes res; + + res =3D VG_(do_syscall2)(__NR_gettimeofday, (UWord)&tv_now, (UWord)NU= LL); + =20 + now =3D tv_now.tv_sec * 1000000ULL + tv_now.tv_usec; + =20 + if (base =3D=3D 0) + base =3D now; + + return (now - base) / 1000; +} + + +void VG_(nanosleep)(struct vki_timespec *ts) +{ + (void)VG_(do_syscall2)(__NR_nanosleep, (UWord)ts, (UWord)NULL); +} + +/* --------------------------------------------------------------------- + A simple atfork() facility for Valgrind's internal use + ------------------------------------------------------------------ */ + +struct atfork { + vg_atfork_t pre; + vg_atfork_t parent; + vg_atfork_t child; +}; + +#define VG_MAX_ATFORK 10 + +static struct atfork atforks[VG_MAX_ATFORK]; +static Int n_atfork; + +void VG_(atfork)(vg_atfork_t pre, vg_atfork_t parent, vg_atfork_t child) +{ + Int i; + + for(i =3D 0; i < n_atfork; i++) { + if (atforks[i].pre =3D=3D pre && + atforks[i].parent =3D=3D parent && + atforks[i].child =3D=3D child) + return; + } + + if (n_atfork >=3D VG_MAX_ATFORK) + VG_(core_panic)("Too many VG_(atfork) handlers requested: " + "raise VG_MAX_ATFORK"); + + atforks[n_atfork].pre =3D pre; + atforks[n_atfork].parent =3D parent; + atforks[n_atfork].child =3D child; + + n_atfork++; +} + +void VG_(do_atfork_pre)(ThreadId tid) +{ + Int i; + + for(i =3D 0; i < n_atfork; i++) + if (atforks[i].pre !=3D NULL) + (*atforks[i].pre)(tid); +} + +void VG_(do_atfork_parent)(ThreadId tid) +{ + Int i; + + for(i =3D 0; i < n_atfork; i++) + if (atforks[i].parent !=3D NULL) + (*atforks[i].parent)(tid); +} + +void VG_(do_atfork_child)(ThreadId tid) +{ + Int i; + + for(i =3D 0; i < n_atfork; i++) + if (atforks[i].child !=3D NULL) + (*atforks[i].child)(tid); +} + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ Modified: trunk/coregrind/m_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/m_main.c 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/coregrind/m_main.c 2005-06-12 02:43:17 UTC (rev 3894) @@ -41,6 +41,7 @@ #include "pub_core_libcfile.h" #include "pub_core_libcmman.h" #include "pub_core_libcprint.h" +#include "pub_core_libcproc.h" #include "pub_core_libcsignal.h" #include "pub_core_main.h" #include "pub_core_mallocfree.h" @@ -111,9 +112,6 @@ Startup stuff =20 ------------------------------------------------------------------ */ =20 -struct vki_rlimit VG_(client_rlimit_data); -struct vki_rlimit VG_(client_rlimit_stack); - /* stage1 (main) executable */ static Int vgexecfd =3D -1; =20 @@ -127,13 +125,7 @@ static Int vg_argc; static Char **vg_argv; =20 -/* As deduced from sp_at_startup, the client's argc, argv[] and - envp[] as extracted from the client's stack at startup-time. */ -Int VG_(client_argc); -Char** VG_(client_argv); -Char** VG_(client_envp); =20 - /* --------------------------------------------------------------------- Running stuff =20 ------------------------------------------------------------------ */ Modified: trunk/coregrind/m_scheduler/scheduler.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_scheduler/scheduler.c 2005-06-12 00:06:24 UTC (rev = 3893) +++ trunk/coregrind/m_scheduler/scheduler.c 2005-06-12 02:43:17 UTC (rev = 3894) @@ -66,6 +66,7 @@ #include "pub_core_libcbase.h" #include "pub_core_libcassert.h" #include "pub_core_libcprint.h" +#include "pub_core_libcproc.h" #include "pub_core_libcsignal.h" #include "pub_core_main.h" #include "pub_core_mallocfree.h" Modified: trunk/coregrind/m_scheduler/sema.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_scheduler/sema.c 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/coregrind/m_scheduler/sema.c 2005-06-12 02:43:17 UTC (rev 3894) @@ -31,6 +31,7 @@ #include "core.h" #include "pub_core_libcassert.h" #include "pub_core_libcfile.h" +#include "pub_core_libcproc.h" #include "priv_sema.h" =20 /*=20 Modified: trunk/coregrind/m_signals.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_signals.c 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/coregrind/m_signals.c 2005-06-12 02:43:17 UTC (rev 3894) @@ -87,6 +87,7 @@ #include "pub_core_libcassert.h" #include "pub_core_libcmman.h" #include "pub_core_libcprint.h" +#include "pub_core_libcproc.h" #include "pub_core_libcsignal.h" #include "pub_core_main.h" #include "pub_core_mallocfree.h" Modified: trunk/coregrind/m_syscalls/syscalls-amd64-linux.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_syscalls/syscalls-amd64-linux.c 2005-06-12 00:06:24= UTC (rev 3893) +++ trunk/coregrind/m_syscalls/syscalls-amd64-linux.c 2005-06-12 02:43:17= UTC (rev 3894) @@ -37,6 +37,7 @@ #include "pub_core_libcassert.h" #include "pub_core_libcmman.h" #include "pub_core_libcprint.h" +#include "pub_core_libcproc.h" #include "pub_core_libcsignal.h" #include "pub_core_sigframe.h" #include "pub_core_signals.h" Modified: trunk/coregrind/m_syscalls/syscalls-generic.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_syscalls/syscalls-generic.c 2005-06-12 00:06:24 UTC= (rev 3893) +++ trunk/coregrind/m_syscalls/syscalls-generic.c 2005-06-12 02:43:17 UTC= (rev 3894) @@ -36,6 +36,7 @@ #include "pub_core_libcfile.h" #include "pub_core_libcmman.h" #include "pub_core_libcprint.h" +#include "pub_core_libcproc.h" #include "pub_core_libcsignal.h" #include "pub_core_main.h" #include "pub_core_mallocfree.h" Modified: trunk/coregrind/m_syscalls/syscalls-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/m_syscalls/syscalls-main.c 2005-06-12 00:06:24 UTC (r= ev 3893) +++ trunk/coregrind/m_syscalls/syscalls-main.c 2005-06-12 02:43:17 UTC (r= ev 3894) @@ -33,6 +33,7 @@ #include "pub_core_libcbase.h" #include "pub_core_libcassert.h" #include "pub_core_libcprint.h" +#include "pub_core_libcproc.h" #include "pub_core_libcsignal.h" #include "pub_core_stacktrace.h" #include "pub_core_tooliface.h" Modified: trunk/coregrind/m_syscalls/syscalls-x86-linux.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_syscalls/syscalls-x86-linux.c 2005-06-12 00:06:24 U= TC (rev 3893) +++ trunk/coregrind/m_syscalls/syscalls-x86-linux.c 2005-06-12 02:43:17 U= TC (rev 3894) @@ -42,6 +42,7 @@ #include "pub_core_libcassert.h" #include "pub_core_libcmman.h" #include "pub_core_libcprint.h" +#include "pub_core_libcproc.h" #include "pub_core_libcsignal.h" #include "pub_core_mallocfree.h" #include "pub_core_sigframe.h" Modified: trunk/coregrind/m_tooliface.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_tooliface.c 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/coregrind/m_tooliface.c 2005-06-12 02:43:17 UTC (rev 3894) @@ -32,6 +32,7 @@ #include "core.h" #include "pub_core_aspacemgr.h" #include "pub_core_libcbase.h" +#include "pub_core_libcassert.h" #include "pub_core_libcprint.h" #include "pub_core_mallocfree.h" #include "pub_core_tooliface.h" Added: trunk/coregrind/pub_core_libcproc.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_libcproc.h 2005-06-12 00:06:24 UTC (rev 3893= ) +++ trunk/coregrind/pub_core_libcproc.h 2005-06-12 02:43:17 UTC (rev 3894= ) @@ -0,0 +1,85 @@ + +/*--------------------------------------------------------------------*/ +/*--- Process-related libc stuff. pub_core_libcproc.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_LIBCPROC_H +#define __PUB_CORE_LIBCPROC_H + +//-------------------------------------------------------------------- +// PURPOSE: This module contains libc code related to the process. +// It's a bit of a mixed bag. +//-------------------------------------------------------------------- + +#include "pub_tool_libcproc.h" + +/* The directory we look for all our auxillary files in */ +#define VALGRINDLIB "VALGRINDLIB" + +/* Additional command-line arguments; they are overridden by actual + command-line option. Each argument is separated by spaces. There + is no quoting mechanism. */ +#define VALGRINDOPTS "VALGRIND_OPTS" + +/* If this variable is present in the environment, then valgrind will + not parse the command line for options at all; all options come + from this variable. Arguments are terminated by ^A (\001). There + is no quoting mechanism. + + This variable is not expected to be set by anything other than + Valgrind itself, as part of its handling of execve with + --trace-children=3Dyes. This variable should not be present in the + client environment. */ +#define VALGRINDCLO "_VALGRIND_CLO" + +// Client's original rlimit data and rlimit stack +extern struct vki_rlimit VG_(client_rlimit_data); +extern struct vki_rlimit VG_(client_rlimit_stack); + +// Environment manipulations +extern Char **VG_(env_setenv) ( Char ***envp, const Char* varname, + const Char *val ); +extern void VG_(env_unsetenv) ( Char **env, const Char *varname ); +extern void VG_(env_remove_valgrind_env_stuff) ( Char** env );=20 + +// misc +extern Int VG_(poll)( struct vki_pollfd *, UInt nfds, Int timeout); +extern void VG_(nanosleep) ( struct vki_timespec * ); + +// atfork +typedef void (*vg_atfork_t)(ThreadId); +extern void VG_(atfork)(vg_atfork_t pre, vg_atfork_t parent, vg_atfork_t= child); +extern void VG_(do_atfork_pre) ( ThreadId tid ); +extern void VG_(do_atfork_parent) ( ThreadId tid ); +extern void VG_(do_atfork_child) ( ThreadId tid ); + +#endif // __PUB_CORE_LIBCPROC_H + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ Modified: trunk/coregrind/pub_core_main.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_main.h 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/coregrind/pub_core_main.h 2005-06-12 02:43:17 UTC (rev 3894) @@ -41,9 +41,6 @@ /* Sanity checks which may be done at any time. The scheduler decides w= hen. */ extern void VG_(sanity_check_general) ( Bool force_expensive ); =20 -extern struct vki_rlimit VG_(client_rlimit_data); /* client's original r= limit data */ -extern struct vki_rlimit VG_(client_rlimit_stack); /* client's original = rlimit stack */ - /* client executable file descriptor */ extern Int VG_(clexecfd); =20 Modified: trunk/coregrind/pub_core_options.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_options.h 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/coregrind/pub_core_options.h 2005-06-12 02:43:17 UTC (rev 3894) @@ -39,22 +39,6 @@ =20 #include "pub_tool_options.h" =20 -/* Additional command-line arguments; they are overridden by actual - command-line option. Each argument is separated by spaces. There - is no quoting mechanism. */ -#define VALGRINDOPTS "VALGRIND_OPTS" - -/* If this variable is present in the environment, then valgrind will - not parse the command line for options at all; all options come - from this variable. Arguments are terminated by ^A (\001). There - is no quoting mechanism. - - This variable is not expected to be set by anything other than - Valgrind itself, as part of its handling of execve with - --trace-children=3Dyes. This variable should not be present in the - client environment. */ -#define VALGRINDCLO "_VALGRIND_CLO" - /* Default destination port to be used in logging over a network, if none specified. */ #define VG_CLO_DEFAULT_LOGPORT 1500 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-06-12 00:06:24 UTC (rev 3893) +++ trunk/coregrind/stage1.c 2005-06-12 02:43:17 UTC (rev 3894) @@ -45,6 +45,7 @@ #include "ume.h" #include "memcheck/memcheck.h" #include "pub_core_debuglog.h" +#include "pub_core_libcproc.h" =20 =20 static int stack[SIGSTKSZ*4]; Deleted: 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-06-12 00:06:24 UTC (rev 3893) +++ trunk/coregrind/vg_mylibc.c 2005-06-12 02:43:17 UTC (rev 3894) @@ -1,504 +0,0 @@ - -/*--------------------------------------------------------------------*/ -/*--- Reimplementation of some C library stuff, to avoid depending ---*/ -/*--- on libc.so. ---*/ -/*--- vg_mylibc.c ---*/ -/*--------------------------------------------------------------------*/ -=20 -/* - 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. -*/ - -#include "core.h" -#include "pub_core_aspacemgr.h" -#include "pub_core_debuglog.h" /* VG_(debugLog_vprintf) */ -#include "pub_core_libcbase.h" -#include "pub_core_libcassert.h" -#include "pub_core_libcprint.h" -#include "pub_core_libcfile.h" -#include "pub_core_main.h" -#include "pub_core_mallocfree.h" -#include "pub_core_options.h" -#include "pub_core_stacktrace.h" -#include "pub_core_syscalls.h" -#include "pub_core_tooliface.h" -#include "vki_unistd.h" - - -Int VG_(waitpid)(Int pid, Int *status, Int options) -{ - SysRes res =3D VG_(do_syscall4)(__NR_wait4, pid, (UWord)status, optio= ns, 0); - return res.isError ? -1 : res.val; -} - -Int VG_(gettid)(void) -{ - SysRes res =3D VG_(do_syscall0)(__NR_gettid); - - if (res.isError && res.val =3D=3D VKI_ENOSYS) { - Char pid[16]; =20 - /* - * The gettid system call does not exist. The obvious assumption - * to make at this point would be that we are running on an older - * system where the getpid system call actually returns the ID of - * the current thread. - * - * Unfortunately it seems that there are some systems with a kerne= l - * where getpid has been changed to return the ID of the thread gr= oup - * leader but where the gettid system call has not yet been added. - * - * So instead of calling getpid here we use readlink to see where - * the /proc/self link is pointing... - */ - - res =3D VG_(do_syscall3)(__NR_readlink, (UWord)"/proc/self", - (UWord)pid, sizeof(pid)); - if (!res.isError && res.val > 0) { - pid[res.val] =3D '\0'; - res.val =3D VG_(atoll)(pid); - } - } - - return res.val; -} - - - -/* --------------------------------------------------------------------- - exit, fcntl - ------------------------------------------------------------------ */ - -/* Pull down the entire world */ -void VG_(exit)( Int status ) -{ - (void)VG_(do_syscall1)(__NR_exit_group, status ); - (void)VG_(do_syscall1)(__NR_exit, status ); - /* Why are we still alive here? */ - /*NOTREACHED*/ - *(volatile Int *)0 =3D 'x'; - vg_assert(2+2 =3D=3D 5); -} - -/* Returns -1 on error. */ -Int VG_(fcntl) ( Int fd, Int cmd, Int arg ) -{ - SysRes res =3D VG_(do_syscall3)(__NR_fcntl, fd, cmd, arg); - return res.isError ? -1 : res.val; -} - -Int VG_(poll)( struct vki_pollfd *ufds, UInt nfds, Int timeout) -{ - SysRes res =3D VG_(do_syscall3)(__NR_poll, (UWord)ufds, nfds, timeout= ); - /* ASSUMES SYSCALL ALWAYS SUCCEEDS */ - return res.val; -} - - -/* --------------------------------------------------------------------- - Misc functions looking for a proper home. - ------------------------------------------------------------------ */ - -/* clone the environment */ -static Char **env_clone ( Char **oldenv ) -{ - Char **oldenvp; - Char **newenvp; - Char **newenv; - Int envlen; - - for (oldenvp =3D oldenv; oldenvp && *oldenvp; oldenvp++); - - envlen =3D oldenvp - oldenv + 1; - =20 - newenv =3D VG_(arena_malloc)(VG_AR_CORE, envlen * sizeof(Char **)); - - oldenvp =3D oldenv; - newenvp =3D newenv; - =20 - while (oldenvp && *oldenvp) { - *newenvp++ =3D *oldenvp++; - } - =20 - *newenvp =3D *oldenvp; - - return newenv; -} - -void VG_(env_unsetenv) ( Char **env, const Char *varname ) -{ - Char **from; - Char **to =3D NULL; - Int len =3D VG_(strlen)(varname); - - for(from =3D to =3D env; from && *from; from++) { - if (!(VG_(strncmp)(varname, *from, len) =3D=3D 0 && (*from)[len] =3D= =3D '=3D')) { - *to =3D *from; - to++; - } - } - *to =3D *from; -} - -/* set the environment; returns the old env if a new one was allocated *= / -Char **VG_(env_setenv) ( Char ***envp, const Char* varname, const Char *= val ) -{ - Char **env =3D (*envp); - Char **cpp; - Int len =3D VG_(strlen)(varname); - Char *valstr =3D VG_(arena_malloc)(VG_AR_CORE, len + VG_(strlen)(val)= + 2); - Char **oldenv =3D NULL; - - VG_(sprintf)(valstr, "%s=3D%s", varname, val); - - for(cpp =3D env; cpp && *cpp; cpp++) { - if (VG_(strncmp)(varname, *cpp, len) =3D=3D 0 && (*cpp)[len] =3D=3D= '=3D') { - *cpp =3D valstr; - return oldenv; - } - } - - if (env =3D=3D NULL) { - env =3D VG_(arena_malloc)(VG_AR_CORE, sizeof(Char **) * 2); - env[0] =3D valstr; - env[1] =3D NULL; - - *envp =3D env; - - } else { - Int envlen =3D (cpp-env) + 2; - Char **newenv =3D VG_(arena_malloc)(VG_AR_CORE, envlen * sizeof(Ch= ar **)); - - for(cpp =3D newenv; *env; ) - *cpp++ =3D *env++; - *cpp++ =3D valstr; - *cpp++ =3D NULL; - - oldenv =3D *envp; - - *envp =3D newenv; - } - - return oldenv; -} - -/* We do getenv without libc's help by snooping around in - VG_(client_envp) as determined at startup time. */ -Char *VG_(getenv)(Char *varname) -{ - Int i, n; - n =3D VG_(strlen)(varname); - for (i =3D 0; VG_(client_envp)[i] !=3D NULL; i++) { - Char* s =3D VG_(client_envp)[i]; - if (VG_(strncmp)(varname, s, n) =3D=3D 0 && s[n] =3D=3D '=3D') { - return & s[n+1]; - } - } - return NULL; -} - -/* Support for getrlimit. */ -Int VG_(getrlimit) (Int resource, struct vki_rlimit *rlim) -{ - SysRes res =3D VG_(mk_SysRes_Error)(VKI_ENOSYS); - /* res =3D getrlimit( resource, rlim ); */ -# ifdef __NR_ugetrlimit - res =3D VG_(do_syscall2)(__NR_ugetrlimit, resource, (UWord)rlim); -# endif - if (res.isError && res.val =3D=3D VKI_ENOSYS) - res =3D VG_(do_syscall2)(__NR_getrlimit, resource, (UWord)rlim); - return res.isError ? -1 : res.val; -} - - -/* Support for setrlimit. */ -Int VG_(setrlimit) (Int resource, const struct vki_rlimit *rlim) -{ - SysRes res; - /* res =3D setrlimit( resource, rlim ); */ - res =3D VG_(do_syscall2)(__NR_setrlimit, resource, (UWord)rlim); - return res.isError ? -1 : res.val; -} - -/* You'd be amazed how many places need to know the current pid. */ -Int VG_(getpid) ( void ) -{ - /* ASSUMES SYSCALL ALWAYS SUCCEEDS */ - return VG_(do_syscall0)(__NR_getpid) . val; -} - -Int VG_(getpgrp) ( void ) -{ - /* ASSUMES SYSCALL ALWAYS SUCCEEDS */ - return VG_(do_syscall0)(__NR_getpgrp) . val; -} - -Int VG_(getppid) ( void ) -{ - /* ASSUMES SYSCALL ALWAYS SUCCEEDS */ - return VG_(do_syscall0)(__NR_getppid) . val; -} - -Int VG_(setpgid) ( Int pid, Int pgrp ) -{ - /* ASSUMES SYSCALL ALWAYS SUCCEEDS */ - return VG_(do_syscall2)(__NR_setpgid, pid, pgrp) . val; -} - -/* Walk through a colon-separated environment variable, and remove the - entries which match remove_pattern. It slides everything down over - the removed entries, and pads the remaining space with '\0'. It - modifies the entries in place (in the client address space), but it - shouldn't matter too much, since we only do this just before an - execve(). - - This is also careful to mop up any excess ':'s, since empty strings - delimited by ':' are considered to be '.' in a path. -*/ -static void mash_colon_env(Char *varp, const Char *remove_pattern) -{ - Char *const start =3D varp; - Char *entry_start =3D varp; - Char *output =3D varp; - - if (varp =3D=3D NULL) - return; - - while(*varp) { - if (*varp =3D=3D ':') { - Char prev; - Bool match; - - /* This is a bit subtle: we want to match against the entry - we just copied, because it may have overlapped with - itself, junking the original. */ - - prev =3D *output; - *output =3D '\0'; - - match =3D VG_(string_match)(remove_pattern, entry_start); - - *output =3D prev; - =20 - if (match) { - output =3D entry_start; - varp++; /* skip ':' after removed entry */ - } else - entry_start =3D output+1; /* entry starts after ':' */ - } - - *output++ =3D *varp++; - } - - /* match against the last entry */ - if (VG_(string_match)(remove_pattern, entry_start)) { - output =3D entry_start; - if (output > start) { - /* remove trailing ':' */ - output--; - vg_assert(*output =3D=3D ':'); - } - } =20 - - /* pad out the left-overs with '\0' */ - while(output < varp) - *output++ =3D '\0'; -} - - -// Removes all the Valgrind-added stuff from the passed environment. Us= ed -// when starting child processes, so they don't see that added stuff. -void VG_(env_remove_valgrind_env_stuff)(Char** envp) -{ - Int i; - Char* ld_preload_str =3D NULL; - Char* ld_library_path_str =3D NULL; - Char* buf; - - // Find LD_* variables - for (i =3D 0; envp[i] !=3D NULL; i++) { - if (VG_(strncmp)(envp[i], "LD_PRELOAD=3D", 11) =3D=3D 0) - ld_preload_str =3D &envp[i][11]; - if (VG_(strncmp)(envp[i], "LD_LIBRARY_PATH=3D", 16) =3D=3D 0) - ld_library_path_str =3D &envp[i][16]; - } - - buf =3D VG_(arena_malloc)(VG_AR_CORE, VG_(strlen)(VG_(libdir)) + 20); - - // Remove Valgrind-specific entries from LD_*. - VG_(sprintf)(buf, "%s*/vg_inject.so", VG_(libdir)); - mash_colon_env(ld_preload_str, buf); - VG_(sprintf)(buf, "%s*/vgpreload_*.so", VG_(libdir)); - mash_colon_env(ld_preload_str, buf); - VG_(sprintf)(buf, "%s*", VG_(libdir)); - mash_colon_env(ld_library_path_str, buf); - - // Remove VALGRIND_CLO variable. - VG_(env_unsetenv)(envp, VALGRINDCLO); - - // XXX if variable becomes empty, remove it completely? - - VG_(arena_free)(VG_AR_CORE, buf); -} - -/* Return -1 if error, else 0. NOTE does not indicate return code of - child! */ -Int VG_(system) ( Char* cmd ) -{ - Int pid; - SysRes res; - if (cmd =3D=3D NULL) - return 1; - res =3D VG_(do_syscall0)(__NR_fork); - if (res.isError) - return -1; - pid =3D res.val; - if (pid =3D=3D 0) { - /* child */ - static Char** envp =3D NULL; - Char* argv[4]; - - /* restore the DATA rlimit for the child */ - VG_(setrlimit)(VKI_RLIMIT_DATA, &VG_(client_rlimit_data)); - - envp =3D env_clone(VG_(client_envp)); - VG_(env_remove_valgrind_env_stuff)( envp );=20 - - argv[0] =3D "/bin/sh"; - argv[1] =3D "-c"; - argv[2] =3D cmd; - argv[3] =3D 0; - - (void)VG_(do_syscall3)(__NR_execve,=20 - (UWord)"/bin/sh", (UWord)argv, (UWord)envp)= ; - - /* If we're still alive here, execve failed. */ - VG_(exit)(1); - } else { - /* parent */ - Int zzz =3D VG_(waitpid)(pid, NULL, 0); - return zzz =3D=3D -1 ? -1 : 0; - } -} - - -/* --------------------------------------------------------------------- - Support for a millisecond-granularity timer. - ------------------------------------------------------------------ */ - -UInt VG_(read_millisecond_timer) ( void ) -{ - static ULong base =3D 0; - struct vki_timeval tv_now; - ULong now; - SysRes res; - - res =3D VG_(do_syscall2)(__NR_gettimeofday, (UWord)&tv_now, (UWord)NU= LL); - =20 - now =3D tv_now.tv_sec * 1000000ULL + tv_now.tv_usec; - =20 - if (base =3D=3D 0) - base =3D now; - - return (now - base) / 1000; -} - - -void VG_(nanosleep)(struct vki_timespec *ts) -{ - (void)VG_(do_syscall2)(__NR_nanosleep, (UWord)ts, (UWord)NULL); -} - -/* --------------------------------------------------------------------- - Misc stuff looking for a proper home - ------------------------------------------------------------------ */ - -/* --------------------------------------------------------------------- - A simple atfork() facility for Valgrind's internal use - ------------------------------------------------------------------ */ - -struct atfork { - vg_atfork_t pre; - vg_atfork_t parent; - vg_atfork_t child; -}; - -#define VG_MAX_ATFORK 10 - -static struct atfork atforks[VG_MAX_ATFORK]; -static Int n_atfork; - -void VG_(atfork)(vg_atfork_t pre, vg_atfork_t parent, vg_atfork_t child) -{ - Int i; - - for(i =3D 0; i < n_atfork; i++) { - if (atforks[i].pre =3D=3D pre && - atforks[i].parent =3D=3D parent && - atforks[i].child =3D=3D child) - return; - } - - if (n_atfork >=3D VG_MAX_ATFORK) - VG_(core_panic)("Too many VG_(atfork) handlers requested: " - "raise VG_MAX_ATFORK"); - - atforks[n_atfork].pre =3D pre; - atforks[n_atfork].parent =3D parent; - atforks[n_atfork].child =3D child; - - n_atfork++; -} - -void VG_(do_atfork_pre)(ThreadId tid) -{ - Int i; - - for(i =3D 0; i < n_atfork; i++) - if (atforks[i].pre !=3D NULL) - (*atforks[i].pre)(tid); -} - -void VG_(do_atfork_parent)(ThreadId tid) -{ - Int i; - - for(i =3D 0; i < n_atfork; i++) - if (atforks[i].parent !=3D NULL) - (*atforks[i].parent)(tid); -} - -void VG_(do_atfork_child)(ThreadId tid) -{ - Int i; - - for(i =3D 0; i < n_atfork; i++) - if (atforks[i].child !=3D NULL) - (*atforks[i].child)(tid); -} - - -/*--------------------------------------------------------------------*/ -/*--- end ---*/ -/*--------------------------------------------------------------------*/ - Modified: trunk/helgrind/hg_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/helgrind/hg_main.c 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/helgrind/hg_main.c 2005-06-12 02:43:17 UTC (rev 3894) @@ -36,6 +36,7 @@ #include "pub_tool_libcbase.h" #include "pub_tool_libcassert.h" #include "pub_tool_libcprint.h" +#include "pub_tool_libcproc.h" #include "pub_tool_mallocfree.h" #include "pub_tool_options.h" #include "pub_tool_profile.h" Modified: trunk/include/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/include/Makefile.am 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/include/Makefile.am 2005-06-12 02:43:17 UTC (rev 3894) @@ -14,6 +14,7 @@ pub_tool_libcfile.h \ pub_tool_libcmman.h \ pub_tool_libcprint.h \ + pub_tool_libcproc.h \ pub_tool_libcsignal.h \ pub_tool_mallocfree.h \ pub_tool_options.h \ Modified: trunk/include/pub_tool_libcassert.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/include/pub_tool_libcassert.h 2005-06-12 00:06:24 UTC (rev 3893= ) +++ trunk/include/pub_tool_libcassert.h 2005-06-12 02:43:17 UTC (rev 3894= ) @@ -46,6 +46,13 @@ 0))) =20 __attribute__ ((__noreturn__)) +extern void VG_(exit)( Int status ); + +/* Prints a panic message, appends newline and bug reporting info, abort= s. */ +__attribute__ ((__noreturn__)) +extern void VG_(tool_panic) ( Char* str ); + +__attribute__ ((__noreturn__)) extern void VG_(assert_fail) ( Bool isCore, const Char* expr, const Char= * file,=20 Int line, const Char* fn,=20 const HChar* format, ... ); Added: trunk/include/pub_tool_libcproc.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/include/pub_tool_libcproc.h 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/include/pub_tool_libcproc.h 2005-06-12 02:43:17 UTC (rev 3894) @@ -0,0 +1,80 @@ + +/*--------------------------------------------------------------------*/ +/*--- Process-related libc stuff pub_tool_libcproc.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_TOOL_LIBCPROC_H +#define __PUB_TOOL_LIBCPROC_H + +/* --------------------------------------------------------------------- + Command-line and environment stuff + ------------------------------------------------------------------ */ + +/* Client args and environment (which can be inspected with VG_(getenv)(= ). */ +extern Int VG_(client_argc); +extern Char** VG_(client_argv); +extern Char** VG_(client_envp); + +/* Looks up VG_(client_envp) */ +extern Char* VG_(getenv) ( Char* name ); + +/* --------------------------------------------------------------------- + Important syscalls + ------------------------------------------------------------------ */ + +extern Int VG_(waitpid)( Int pid, Int *status, Int options ); +extern Int VG_(system) ( Char* cmd ); + +/* --------------------------------------------------------------------- + Resource limits + ------------------------------------------------------------------ */ + +extern Int VG_(getrlimit) ( Int resource, struct vki_rlimit *rlim ); +extern Int VG_(setrlimit) ( Int resource, const struct vki_rlimit *rlim = ); + +/* --------------------------------------------------------------------- + pids, etc + ------------------------------------------------------------------ */ + +extern Int VG_(gettid) ( void ); +extern Int VG_(getpid) ( void ); +extern Int VG_(getppid) ( void ); +extern Int VG_(getpgrp) ( void ); +extern Int VG_(setpgid) ( Int pid, Int pgrp ); + +/* --------------------------------------------------------------------- + Timing + ------------------------------------------------------------------ */ + +extern UInt VG_(read_millisecond_timer) ( void ); + +#endif // __PUB_TOOL_LIBCPROC_H + +/*--------------------------------------------------------------------*/ +/*--- end ---*/ +/*--------------------------------------------------------------------*/ Modified: trunk/include/tool.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/include/tool.h 2005-06-12 00:06:24 UTC (rev 3893) +++ trunk/include/tool.h 2005-06-12 02:43:17 UTC (rev 3894) @@ -66,14 +66,6 @@ /* Path to all our library/aux files */ extern const Char *VG_(libdir); =20 -/* Client args */ -extern Int VG_(client_argc); -extern Char** VG_(client_argv); - -/* Client environment. Can be inspected with VG_(getenv)() */ -extern Char** VG_(client_envp); - - /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ /*=3D=3D=3D Useful stuff to call from generated code = =3D=3D=3D*/ /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ @@ -105,38 +97,6 @@ /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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 /* ------------------------------------------------------------------ */ -/* stdlib.h */ - -/* terminate everything */ -extern void VG_(exit)( Int status ) - __attribute__ ((__noreturn__)); - -/* Prints a panic message (a constant string), appends newline and bug - reporting info, aborts. */ -__attribute__ ((__noreturn__)) -extern void VG_(tool_panic) ( Char* str ); - -/* Looks up VG_(client_envp) */ -extern Char* VG_(getenv) ( Char* name ); - -/* Get client resource limit*/ -extern Int VG_(getrlimit) ( Int resource, struct vki_rlimit *rlim ); - -/* Set client resource limit*/ -extern Int VG_(setrlimit) ( Int resource, const struct vki_rlimit *rlim = ); - -/* Crude stand-in for ... [truncated message content] |
|
From: Tom H. <th...@cy...> - 2005-06-12 02:20:32
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2005-06-12 03:15: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 == 175 tests, 13 stderr failures, 0 stdout failures ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (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/vgtest_ume (stderr) memcheck/tests/xml1 (stderr) corecheck/tests/fdleak_cmsg (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-06-12 02:19:35
|
Nightly build on dellow ( x86_64, Fedora Core 3 ) started at 2005-06-12 03:10: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, 10 stderr failures, 3 stdout failures ================= memcheck/tests/brk (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/sigprocmask (stderr) memcheck/tests/toobig-allocs (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) corecheck/tests/stack_changes (stdout) corecheck/tests/stack_changes (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-06-12 02:05:11
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2005-06-12 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, 11 stderr failures, 2 stdout failures ================= memcheck/tests/brk (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/sigprocmask (stderr) memcheck/tests/toobig-allocs (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/stack_changes (stdout) corecheck/tests/stack_changes (stderr) massif/tests/toobig-allocs (stderr) none/tests/faultstatus (stderr) none/tests/selfrun (stdout) none/tests/selfrun (stderr) |
|
From: <sv...@va...> - 2005-06-12 00:06:30
|
Author: njn
Date: 2005-06-12 01:06:24 +0100 (Sun, 12 Jun 2005)
New Revision: 3893
Log:
Move comment to the right place.
Modified:
trunk/coregrind/core.h
trunk/coregrind/pub_core_libcbase.h
Modified: trunk/coregrind/core.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/core.h 2005-06-11 17:19:18 UTC (rev 3892)
+++ trunk/coregrind/core.h 2005-06-12 00:06:24 UTC (rev 3893)
@@ -148,12 +148,6 @@
Exports of vg_syscall.S
------------------------------------------------------------------ */
=20
-// We use a full prototype rather than "..." here to ensure that all
-// arguments get converted to a UWord appropriately. Not doing so can
-// cause problems when passing 32-bit integers on 64-bit platforms, beca=
use
-// the top 32-bits might not be zeroed appropriately, eg. as would happe=
n
-// with the 6th arg on AMD64 which is passed on the stack.
-
extern void VG_(sigreturn)(void);
=20
/* ---------------------------------------------------------------------
Modified: trunk/coregrind/pub_core_libcbase.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_libcbase.h 2005-06-11 17:19:18 UTC (rev 3892=
)
+++ trunk/coregrind/pub_core_libcbase.h 2005-06-12 00:06:24 UTC (rev 3893=
)
@@ -46,6 +46,12 @@
/* Do a syscall on this platform, with 6 args, and return the result
in canonical format in a SysRes value. */
=20
+// We use a full prototype for VG_(do_syscall) rather than "..." to ensu=
re
+// that all arguments get converted to a UWord appropriately. Not doing=
so
+// can cause problems when passing 32-bit integers on 64-bit platforms,
+// because the top 32-bits might not be zeroed appropriately, eg. as wou=
ld
+// happen with the 6th arg on AMD64 which is passed on the stack.
+
extern SysRes VG_(do_syscall) ( UWord sysno,=20
UWord, UWord, UWord,=20
UWord, UWord, UWord );
|