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-04 23:15:13
|
Author: sewardj
Date: 2005-06-05 00:14:53 +0100 (Sun, 05 Jun 2005)
New Revision: 3848
Modified:
trunk/configure.in
Log:
gcc-3.0.4 (x86) doesn't understand -m32, so autoconfiscate it
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-04 23:13:46 UTC (rev 3847)
+++ trunk/configure.in 2005-06-04 23:14:53 UTC (rev 3848)
@@ -62,7 +62,7 @@
DEFAULT_SUPP=3D""
=20
=20
-# We don't want gcc 2.7
+# We don't want gcc < 3.0
AC_MSG_CHECKING([for a supported version of gcc])
=20
gcc_version=3D`${CC} --version | head -n 1`
@@ -70,8 +70,16 @@
case "${gcc_version}" in
gcc-2.7.*)
AC_MSG_RESULT([no (${gcc_version})])
- AC_MSG_ERROR([please use a recent (>=3D gcc-2.95) version of gcc])
+ AC_MSG_ERROR([please use a recent (>=3D gcc-3.0) version of gcc])
;;
+ gcc-2.8.*)
+ AC_MSG_RESULT([no (${gcc_version})])
+ AC_MSG_ERROR([please use a recent (>=3D gcc-3.0) version of gcc])
+ ;;
+ gcc-2.9*)
+ AC_MSG_RESULT([no (${gcc_version})])
+ AC_MSG_ERROR([please use a recent (>=3D gcc-3.0) version of gcc])
+ ;;
=20
*)
AC_MSG_RESULT([ok (${gcc_version})])
@@ -96,9 +104,9 @@
AC_MSG_RESULT([ok (${host_cpu})])
VG_ARCH=3D"x86"
KICKSTART_BASE=3D"0xb0000000"
- ARCH_CORE_AM_CFLAGS=3D"-m32 @PREFERRED_STACK_BOUNDARY@ -DELFSZ=3D=
32"
- ARCH_TOOL_AM_CFLAGS=3D"-m32 @PREFERRED_STACK_BOUNDARY@"
- ARCH_CORE_AM_CCASFLAGS=3D"-m32"
+ ARCH_CORE_AM_CFLAGS=3D"@FLAG_M32@ @PREFERRED_STACK_BOUNDARY@ -DE=
LFSZ=3D32"
+ ARCH_TOOL_AM_CFLAGS=3D"@FLAG_M32@ @PREFERRED_STACK_BOUNDARY@"
+ ARCH_CORE_AM_CCASFLAGS=3D"@FLAG_M32@"
;;
=20
x86_64)=20
@@ -268,6 +276,7 @@
;;
esac
=20
+
# We don't know how to detect the X client library version
# (detecting the server version is easy, bu no help). So we
# just use a hack: always include the suppressions for both
@@ -279,6 +288,27 @@
fi
=20
=20
+# does this compiler support -m32 ?
+AC_MSG_CHECKING([if gcc accepts -m32])
+
+safe_CFLAGS=3D$CFLAGS
+CFLAGS=3D"-m32"
+
+AC_TRY_COMPILE(, [
+int main () { return 0 ; }
+],
+[
+FLAG_M32=3D"-m32"
+AC_MSG_RESULT([yes])
+], [
+FLAG_M32=3D""
+AC_MSG_RESULT([no])
+])
+CFLAGS=3D$safe_CFLAGS
+
+AC_SUBST(FLAG_M32)
+
+
# does this compiler support -mpreferred-stack-boundary=3D2 ?
AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary])
=20
@@ -299,6 +329,7 @@
=20
AC_SUBST(PREFERRED_STACK_BOUNDARY)
=20
+
# does this compiler support -Wno-pointer-sign ?
AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign ])
=20
@@ -321,6 +352,7 @@
CFLAGS=3D"$CFLAGS -Wno-pointer-sign"
fi
=20
+
# Check for TLS support in the compiler and linker
AC_CACHE_CHECK([for TLS support], vg_cv_tls,
[AC_ARG_ENABLE(tls, [ --enable-tls platform supports=
TLS],
@@ -334,6 +366,7 @@
AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variab=
les])
fi
=20
+
# Check for PIE support in the compiler and linker
AC_SUBST(PIE_AM_CFLAGS)
AC_CACHE_CHECK([for PIE support], vg_cv_pie,
@@ -360,12 +393,14 @@
AC_HEADER_STDC
AC_CHECK_HEADERS([sys/endian.h endian.h mqueue.h])
=20
+
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
=20
+
# Checks for library functions.
AC_FUNC_MEMCMP
AC_FUNC_MMAP
|
|
From: <sv...@va...> - 2005-06-04 23:13:52
|
Author: sewardj
Date: 2005-06-05 00:13:46 +0100 (Sun, 05 Jun 2005)
New Revision: 3847
Modified:
trunk/coregrind/pub_core_tooliface.h
Log:
gcc-3.0.4 build fix.
Modified: trunk/coregrind/pub_core_tooliface.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_tooliface.h 2005-06-04 20:42:33 UTC (rev 384=
6)
+++ trunk/coregrind/pub_core_tooliface.h 2005-06-04 23:13:46 UTC (rev 384=
7)
@@ -153,18 +153,18 @@
void (*track_die_mem_brk) (Addr, SizeT);
void (*track_die_mem_munmap) (Addr, SizeT);
=20
- VGA_REGPARM(1) void (*track_new_mem_stack_4) (Addr);
- VGA_REGPARM(1) void (*track_new_mem_stack_8) (Addr);
- VGA_REGPARM(1) void (*track_new_mem_stack_12)(Addr);
- VGA_REGPARM(1) void (*track_new_mem_stack_16)(Addr);
- VGA_REGPARM(1) void (*track_new_mem_stack_32)(Addr);
+ void VGA_REGPARM(1) (*track_new_mem_stack_4) (Addr);
+ void VGA_REGPARM(1) (*track_new_mem_stack_8) (Addr);
+ void VGA_REGPARM(1) (*track_new_mem_stack_12)(Addr);
+ void VGA_REGPARM(1) (*track_new_mem_stack_16)(Addr);
+ void VGA_REGPARM(1) (*track_new_mem_stack_32)(Addr);
void (*track_new_mem_stack)(Addr, SizeT);
=20
- VGA_REGPARM(1) void (*track_die_mem_stack_4) (Addr);
- VGA_REGPARM(1) void (*track_die_mem_stack_8) (Addr);
- VGA_REGPARM(1) void (*track_die_mem_stack_12)(Addr);
- VGA_REGPARM(1) void (*track_die_mem_stack_16)(Addr);
- VGA_REGPARM(1) void (*track_die_mem_stack_32)(Addr);
+ void VGA_REGPARM(1) (*track_die_mem_stack_4) (Addr);
+ void VGA_REGPARM(1) (*track_die_mem_stack_8) (Addr);
+ void VGA_REGPARM(1) (*track_die_mem_stack_12)(Addr);
+ void VGA_REGPARM(1) (*track_die_mem_stack_16)(Addr);
+ void VGA_REGPARM(1) (*track_die_mem_stack_32)(Addr);
void (*track_die_mem_stack)(Addr, SizeT);
=20
void (*track_ban_mem_stack)(Addr, SizeT);
|
|
From: Robert W. <rj...@du...> - 2005-06-04 21:38:34
|
The stack_changes.c test (in corecheck/tests) kills vex on x86-64 with
this message:
unhandled opc_aux =3D 0x 6
first_opcode =3D=3D 0xD9
vex amd64->IR: unhandled instruction bytes: 0xD9 0x31 0xF 0xAE
=20
Process terminating with default action of signal 4 (SIGILL)
Illegal opcode at address 0x25786CDE
at 0x25786CDE: getcontext (in /...libc...)
by 0x4009CF: init_context (stack_changes.c:25)
by 0x400AB2: main (stack_changes.c:47)
Works fine on x86.
Regards,
Robert.
--=20
Robert Walsh
Amalgamated Durables, Inc. - "We don't make the things you buy."
Email: rj...@du...
|
|
From: Robert W. <rj...@du...> - 2005-06-04 21:04:21
|
SVN commit 422246 by rjwalsh: Implement stack registration client requests. See the documentation in coregrind_core.html for details. There's a sample program in stack_changes.c in corecheck/tests. _M corecheck/tests (directory) =20 M +4 -2 corecheck/tests/Makefile.am =20 A corecheck/tests/stack_changes.c [License: no copyright] A corecheck/tests/stack_changes.stderr.exp =20 A corecheck/tests/stack_changes.stdout.exp =20 A corecheck/tests/stack_changes.vgtest =20 M +5 -0 coregrind/core.h =20 M +20 -0 coregrind/docs/coregrind_core.html =20 M +6 -0 coregrind/vg_main.c =20 M +184 -1 coregrind/vg_memory.c =20 M +15 -0 coregrind/vg_scheduler.c =20 M +4 -0 coregrind/vg_signals.c =20 M +32 -1 include/valgrind.h.in =20 |
|
From: <sv...@va...> - 2005-06-04 20:33:56
|
Author: rjwalsh Date: 2005-06-04 21:33:51 +0100 (Sat, 04 Jun 2005) New Revision: 3845 Modified: trunk/docs/ Log: Update ignores. Property changes on: trunk/docs ___________________________________________________________________ Name: svn:ignore - Makefile Makefile.in + Makefile Makefile.in html |
Author: njn
Date: 2005-06-04 21:03:55 +0100 (Sat, 04 Jun 2005)
New Revision: 3844
Added:
trunk/coregrind/m_libcfile.c
trunk/coregrind/pub_core_libcfile.h
trunk/include/pub_tool_libcfile.h
Modified:
trunk/cachegrind/cg_main.c
trunk/coregrind/Makefile.am
trunk/coregrind/core.h
trunk/coregrind/m_aspacemgr/aspacemgr.c
trunk/coregrind/m_aspacemgr/read_procselfmaps.c
trunk/coregrind/m_debuginfo/symtab.c
trunk/coregrind/m_errormgr.c
trunk/coregrind/m_libcprint.c
trunk/coregrind/m_main.c
trunk/coregrind/m_scheduler/sema.c
trunk/coregrind/m_syscalls/syscalls-linux.c
trunk/coregrind/m_syscalls/syscalls.c
trunk/coregrind/vg_mylibc.c
trunk/include/Makefile.am
trunk/include/tool.h
trunk/massif/ms_main.c
Log:
Modularised file and socket libc stuff in m_libcfile.
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-04 19:36:34 UTC (rev 3843)
+++ trunk/cachegrind/cg_main.c 2005-06-04 20:03:55 UTC (rev 3844)
@@ -34,6 +34,7 @@
#include "pub_tool_hashtable.h"
#include "pub_tool_libcbase.h"
#include "pub_tool_libcassert.h"
+#include "pub_tool_libcfile.h"
#include "pub_tool_libcprint.h"
#include "pub_tool_mallocfree.h"
#include "pub_tool_options.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-04 19:36:34 UTC (rev 3843)
+++ trunk/coregrind/Makefile.am 2005-06-04 20:03:55 UTC (rev 3844)
@@ -48,6 +48,7 @@
pub_core_hashtable.h \
pub_core_libcbase.h \
pub_core_libcassert.h \
+ pub_core_libcfile.h \
pub_core_libcprint.h \
pub_core_main.h \
pub_core_mallocfree.h \
@@ -92,6 +93,7 @@
m_hashtable.c \
m_libcbase.c \
m_libcassert.c \
+ m_libcfile.c \
m_libcprint.c \
m_main.c \
m_mallocfree.c \
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-04 19:36:34 UTC (rev 3843)
+++ trunk/coregrind/core.h 2005-06-04 20:03:55 UTC (rev 3844)
@@ -112,14 +112,6 @@
extern Int VG_(mprotect_native)( void *start, SizeT length, UInt prot );
=20
=20
-/* Move an fd into the Valgrind-safe range */
-Int VG_(safe_fd)(Int oldfd);
-
-extern Int VG_(write_socket)( Int sd, void *msg, Int count );
-
-/* --- Connecting over the network --- */
-extern Int VG_(connect_via_socket)( UChar* str );
-
/* Environment manipulations */
extern Char **VG_(env_setenv) ( Char ***envp, const Char* varname,
const Char *val );
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-04 19:36:34 UTC (rev =
3843)
+++ trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-06-04 20:03:55 UTC (rev =
3844)
@@ -34,6 +34,7 @@
#include "pub_core_aspacemgr.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
+#include "pub_core_libcfile.h" // For VG_(fstat)()
#include "pub_core_libcprint.h"
#include "pub_core_options.h"
#include "pub_core_syscalls.h"
Modified: trunk/coregrind/m_aspacemgr/read_procselfmaps.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/read_procselfmaps.c 2005-06-04 19:36:34 U=
TC (rev 3843)
+++ trunk/coregrind/m_aspacemgr/read_procselfmaps.c 2005-06-04 20:03:55 U=
TC (rev 3844)
@@ -34,6 +34,7 @@
#include "pub_core_aspacemgr.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
+#include "pub_core_libcfile.h"
#include "pub_core_libcprint.h"
=20
/* Size of a smallish table used to read /proc/self/map entries. */
Modified: trunk/coregrind/m_debuginfo/symtab.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_debuginfo/symtab.c 2005-06-04 19:36:34 UTC (rev 384=
3)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-06-04 20:03:55 UTC (rev 384=
4)
@@ -34,6 +34,7 @@
#include "pub_core_demangle.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
+#include "pub_core_libcfile.h"
#include "pub_core_libcprint.h"
#include "pub_core_options.h"
#include "pub_core_profile.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-04 19:36:34 UTC (rev 3843)
+++ trunk/coregrind/m_errormgr.c 2005-06-04 20:03:55 UTC (rev 3844)
@@ -34,6 +34,7 @@
#include "pub_core_execontext.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
+#include "pub_core_libcfile.h"
#include "pub_core_libcprint.h"
#include "pub_core_main.h" // for VG_(start_debugger)()
#include "pub_core_options.h"
@@ -1107,5 +1108,5 @@
}
=20
/*--------------------------------------------------------------------*/
-/*--- end m_errormgr.c ---*/
+/*--- end ---*/
/*--------------------------------------------------------------------*/
Added: 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-04 19:36:34 UTC (rev 3843)
+++ trunk/coregrind/m_libcfile.c 2005-06-04 20:03:55 UTC (rev 3844)
@@ -0,0 +1,446 @@
+
+/*--------------------------------------------------------------------*/
+/*--- File- and socket-related libc stuff. m_libcfile.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_libcfile.h"
+#include "pub_core_options.h"
+#include "pub_core_syscalls.h" // For VG_(is_kerror)()
+#include "vki_unistd.h"
+
+/* ---------------------------------------------------------------------
+ File stuff
+ ------------------------------------------------------------------ */
+
+static inline Bool fd_exists(Int fd)
+{
+ struct vki_stat st;
+
+ return VG_(fstat)(fd, &st) =3D=3D 0;
+}
+
+/* Move an fd into the Valgrind-safe range */
+Int VG_(safe_fd)(Int oldfd)
+{
+ Int newfd;
+
+ vg_assert(VG_(fd_hard_limit) !=3D -1);
+
+ newfd =3D VG_(fcntl)(oldfd, VKI_F_DUPFD, VG_(fd_hard_limit));
+ if (newfd !=3D -1)
+ VG_(close)(oldfd);
+
+ VG_(fcntl)(newfd, VKI_F_SETFD, VKI_FD_CLOEXEC);
+
+ vg_assert(newfd >=3D VG_(fd_hard_limit));
+ return newfd;
+}
+
+/* Returns -1 on failure. */
+Int VG_(open) ( const Char* pathname, Int flags, Int mode )
+{ =20
+ Int fd =3D VG_(do_syscall3)(__NR_open, (UWord)pathname, flags, mode);
+ return fd;
+}
+
+void VG_(close) ( Int fd )
+{
+ VG_(do_syscall1)(__NR_close, fd);
+}
+
+Int VG_(read) ( Int fd, void* buf, Int count)
+{
+ Int res;
+ res =3D VG_(do_syscall3)(__NR_read, fd, (UWord)buf, count);
+ return res;
+}
+
+Int VG_(write) ( Int fd, const void* buf, Int count)
+{
+ Int res;
+ res =3D VG_(do_syscall3)(__NR_write, fd, (UWord)buf, count);
+ return res;
+}
+
+Int VG_(pipe) ( Int fd[2] )
+{
+ Int ret =3D VG_(do_syscall1)(__NR_pipe, (UWord)fd);
+ return VG_(is_kerror)(ret) ? -1 : 0;
+}
+
+OffT VG_(lseek) ( Int fd, OffT offset, Int whence)
+{
+ Int res;
+ res =3D VG_(do_syscall3)(__NR_lseek, fd, offset, whence);
+ if (VG_(is_kerror)(res)) res =3D -1;
+ return res;
+}
+
+Int VG_(stat) ( Char* file_name, struct vki_stat* buf )
+{
+ Int res;
+ res =3D VG_(do_syscall2)(__NR_stat, (UWord)file_name, (UWord)buf);
+ return res; /* return -ve error */
+}
+
+Int VG_(fstat) ( Int fd, struct vki_stat* buf )
+{
+ Int res;
+ res =3D VG_(do_syscall2)(__NR_fstat, fd, (UWord)buf);
+ return VG_(is_kerror)(res) ? (-1) : 0;
+}
+
+Int VG_(dup2) ( Int oldfd, Int newfd )
+{
+ Int res;
+ res =3D VG_(do_syscall2)(__NR_dup2, oldfd, newfd);
+ return VG_(is_kerror)(res) ? (-1) : res;
+}
+
+Int VG_(rename) ( Char* old_name, Char* new_name )
+{
+ Int res;
+ res =3D VG_(do_syscall2)(__NR_rename, (UWord)old_name, (UWord)new_nam=
e);
+ return VG_(is_kerror)(res) ? (-1) : 0;
+}
+
+Int VG_(unlink) ( Char* file_name )
+{
+ Int res;
+ res =3D VG_(do_syscall1)(__NR_unlink, (UWord)file_name);
+ return VG_(is_kerror)(res) ? (-1) : 0;
+}
+
+/* Nb: we do not allow the Linux extension which malloc()s memory for th=
e
+ buffer if buf=3D=3DNULL, because we don't want Linux calling malloc()=
*/
+Char* VG_(getcwd) ( Char* buf, SizeT size )
+{
+ Word res;
+ vg_assert(buf !=3D NULL);
+ res =3D VG_(do_syscall2)(__NR_getcwd, (UWord)buf, size);
+ return VG_(is_kerror)(res) ? ((Char*)NULL) : (Char*)res;
+}
+
+/* Alternative version that does allocate the memory. Easier to use. */
+Bool VG_(getcwd_alloc) ( Char** out )
+{
+ SizeT size =3D 4;
+
+ *out =3D NULL;
+ while (True) {
+ *out =3D VG_(malloc)(size);
+ if (NULL =3D=3D VG_(getcwd)(*out, size)) {
+ VG_(free)(*out);
+ if (size > 65535)
+ return False;
+ size *=3D 2;
+ } else {
+ return True;
+ }
+ }
+}
+
+Int VG_(readlink) (Char* path, Char* buf, UInt bufsiz)
+{
+ Int res;
+ /* res =3D readlink( path, buf, bufsiz ); */
+ res =3D VG_(do_syscall3)(__NR_readlink, (UWord)path, (UWord)buf, bufs=
iz);
+ if (VG_(is_kerror)(res)) res =3D -1;
+ return res;
+}
+
+Int VG_(getdents) (UInt fd, struct vki_dirent *dirp, UInt count)
+{
+ Int res;
+ /* res =3D getdents( fd, dirp, count ); */
+ res =3D VG_(do_syscall3)(__NR_getdents, fd, (UWord)dirp, count);
+ if (VG_(is_kerror)(res)) res =3D -1;
+ return res;
+}
+
+/* ---------------------------------------------------------------------
+ Socket-related stuff. This is very Linux-kernel specific.
+ ------------------------------------------------------------------ */
+
+static
+Int parse_inet_addr_and_port ( UChar* str, UInt* ip_addr, UShort* port )=
;
+
+static
+Int my_socket ( Int domain, Int type, Int protocol );
+
+static
+Int my_connect ( Int sockfd, struct vki_sockaddr_in* serv_addr,=20
+ Int addrlen );
+
+static=20
+UInt my_htonl ( UInt x )
+{
+ return
+ (((x >> 24) & 0xFF) << 0) | (((x >> 16) & 0xFF) << 8)
+ | (((x >> 8) & 0xFF) << 16) | (((x >> 0) & 0xFF) << 24);
+}
+
+static
+UShort my_htons ( UShort x )
+{
+ return
+ (((x >> 8) & 0xFF) << 0) | (((x >> 0) & 0xFF) << 8);
+}
+
+
+/* The main function.=20
+
+ Supplied string contains either an ip address "192.168.0.1" or
+ an ip address and port pair, "192.168.0.1:1500". Parse these,
+ and return:
+ -1 if there is a parse error
+ -2 if no parse error, but specified host:port cannot be opened
+ the relevant file (socket) descriptor, otherwise.
+ is used.
+*/
+Int VG_(connect_via_socket)( UChar* str )
+{
+ Int sd, res;
+ struct vki_sockaddr_in servAddr;
+ UInt ip =3D 0;
+ UShort port =3D VG_CLO_DEFAULT_LOGPORT;
+ Bool ok =3D parse_inet_addr_and_port(str, &ip, &port);
+ if (!ok)=20
+ return -1;
+
+ //if (0)
+ // VG_(printf)("ip =3D %d.%d.%d.%d, port %d\n",
+ // (ip >> 24) & 0xFF, (ip >> 16) & 0xFF,=20
+ // (ip >> 8) & 0xFF, ip & 0xFF,=20
+ // (UInt)port );
+
+ servAddr.sin_family =3D VKI_AF_INET;
+ servAddr.sin_addr.s_addr =3D my_htonl(ip);
+ servAddr.sin_port =3D my_htons(port);
+
+ /* create socket */
+ sd =3D my_socket(VKI_AF_INET, VKI_SOCK_STREAM, 0 /* IPPROTO_IP ? */);
+ if (sd < 0) {
+ /* this shouldn't happen ... nevertheless */
+ return -2;
+ }
+ =09
+ /* connect to server */
+ res =3D my_connect(sd, (struct vki_sockaddr_in *) &servAddr,=20
+ sizeof(servAddr));
+ if (res < 0) {
+ /* connection failed */
+ return -2;
+ }
+
+ return sd;
+}
+
+
+/* Let d =3D one or more digits. Accept either:
+ d.d.d.d or d.d.d.d:d
+*/
+Int parse_inet_addr_and_port ( UChar* str, UInt* ip_addr, UShort* port )
+{
+# define GET_CH ((*str) ? (*str++) : 0)
+ UInt ipa, i, j, c, any;
+ ipa =3D 0;
+ for (i =3D 0; i < 4; i++) {
+ j =3D 0;
+ any =3D 0;
+ while (1) {
+ c =3D GET_CH;=20
+ if (c < '0' || c > '9') break;
+ j =3D 10 * j + (int)(c - '0');
+ any =3D 1;
+ }
+ if (any =3D=3D 0 || j > 255) goto syntaxerr;
+ ipa =3D (ipa << 8) + j;
+ if (i <=3D 2 && c !=3D '.') goto syntaxerr;
+ }
+ if (c =3D=3D 0 || c =3D=3D ':')=20
+ *ip_addr =3D ipa;
+ if (c =3D=3D 0) goto ok;
+ if (c !=3D ':') goto syntaxerr;
+ j =3D 0;
+ any =3D 0;
+ while (1) {
+ c =3D GET_CH;=20
+ if (c < '0' || c > '9') break;
+ j =3D j * 10 + (int)(c - '0');
+ any =3D 1;
+ if (j > 65535) goto syntaxerr;
+ }
+ if (any =3D=3D 0 || c !=3D 0) goto syntaxerr;
+ if (j < 1024) goto syntaxerr;
+ *port =3D (UShort)j;
+ ok:
+ return 1;
+ syntaxerr:
+ return 0;
+# undef GET_CH
+}
+
+
+static
+Int my_socket ( Int domain, Int type, Int protocol )
+{
+// AMD64/Linux doesn't define __NR_socketcall... see comment above
+// VG_(sigpending)() for more details.
+#ifdef __amd64__
+ I_die_here;
+#else
+ Int res;
+ UWord args[3];
+ args[0] =3D domain;
+ args[1] =3D type;
+ args[2] =3D protocol;
+ res =3D VG_(do_syscall2)(__NR_socketcall, VKI_SYS_SOCKET, (UWord)&arg=
s);
+ if (VG_(is_kerror)(res))=20
+ res =3D -1;
+ return res;
+#endif
+}
+
+static
+Int my_connect ( Int sockfd, struct vki_sockaddr_in* serv_addr,=20
+ Int addrlen )
+{
+// AMD64/Linux doesn't define __NR_socketcall... see comment above
+// VG_(sigpending)() for more details.
+#ifdef __amd64__
+ I_die_here;
+#else
+ Int res;
+ UWord args[3];
+ args[0] =3D sockfd;
+ args[1] =3D (UWord)serv_addr;
+ args[2] =3D addrlen;
+ res =3D VG_(do_syscall2)(__NR_socketcall, VKI_SYS_CONNECT, (UWord)&ar=
gs);
+ if (VG_(is_kerror)(res))=20
+ res =3D -1;
+ return res;
+#endif
+}
+
+Int VG_(write_socket)( Int sd, void *msg, Int count )
+{
+// AMD64/Linux doesn't define __NR_socketcall... see comment above
+// VG_(sigpending)() for more details.
+#ifdef __amd64__
+ I_die_here;
+#else
+ /* This is actually send(). */
+
+ /* Requests not to send SIGPIPE on errors on stream oriented
+ sockets when the other end breaks the connection. The EPIPE
+ error is still returned. */
+ Int flags =3D VKI_MSG_NOSIGNAL;
+
+ Int res;
+ UWord args[4];
+ args[0] =3D sd;
+ args[1] =3D (UWord)msg;
+ args[2] =3D count;
+ args[3] =3D flags;
+ res =3D VG_(do_syscall2)(__NR_socketcall, VKI_SYS_SEND, (UWord)&args)=
;
+ if (VG_(is_kerror)(res))=20
+ res =3D -1;
+ return res;
+#endif
+}
+
+Int VG_(getsockname) ( Int sd, struct vki_sockaddr *name, Int *namelen)
+{
+// AMD64/Linux doesn't define __NR_socketcall... see comment above
+// VG_(sigpending)() for more details.
+#ifdef __amd64__
+ I_die_here;
+#else
+ Int res;
+ UWord args[3];
+ args[0] =3D sd;
+ args[1] =3D (UWord)name;
+ args[2] =3D (UWord)namelen;
+ res =3D VG_(do_syscall2)(__NR_socketcall, VKI_SYS_GETSOCKNAME, (UWord=
)&args);
+ if(VG_(is_kerror)(res))
+ res =3D -1;
+ return res;
+#endif
+}
+
+Int VG_(getpeername) ( Int sd, struct vki_sockaddr *name, Int *namelen)
+{
+// AMD64/Linux doesn't define __NR_socketcall... see comment above
+// VG_(sigpending)() for more details.
+#ifdef __amd64__
+ I_die_here;
+#else
+ Int res;
+ UWord args[3];
+ args[0] =3D sd;
+ args[1] =3D (UWord)name;
+ args[2] =3D (UWord)namelen;
+ res =3D VG_(do_syscall2)(__NR_socketcall, VKI_SYS_GETPEERNAME, (UWord=
)&args);
+ if(VG_(is_kerror)(res))
+ res =3D -1;
+ return res;
+#endif
+}
+
+Int VG_(getsockopt) ( Int sd, Int level, Int optname, void *optval,
+ Int *optlen)
+{
+// AMD64/Linux doesn't define __NR_socketcall... see comment above
+// VG_(sigpending)() for more details.
+#ifdef __amd64__
+ I_die_here;
+#else
+ Int res;
+ UWord args[5];
+ args[0] =3D sd;
+ args[1] =3D level;
+ args[2] =3D optname;
+ args[3] =3D (UWord)optval;
+ args[4] =3D (UWord)optlen;
+ res =3D VG_(do_syscall2)(__NR_socketcall, VKI_SYS_GETSOCKOPT, (UWord)=
&args);
+ if(VG_(is_kerror)(res))
+ res =3D -1;
+ return res;
+#endif
+}
+
+
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
+
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-04 19:36:34 UTC (rev 3843)
+++ trunk/coregrind/m_libcprint.c 2005-06-04 20:03:55 UTC (rev 3844)
@@ -32,6 +32,7 @@
#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_options.h"
#include "valgrind.h" // for RUNNING_ON_VALGRIND
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-04 19:36:34 UTC (rev 3843)
+++ trunk/coregrind/m_main.c 2005-06-04 20:03:55 UTC (rev 3844)
@@ -38,6 +38,7 @@
#include "pub_core_execontext.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
+#include "pub_core_libcfile.h"
#include "pub_core_libcprint.h"
#include "pub_core_main.h"
#include "pub_core_options.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-04 19:36:34 UTC (rev 3843)
+++ trunk/coregrind/m_scheduler/sema.c 2005-06-04 20:03:55 UTC (rev 3844)
@@ -30,6 +30,7 @@
=20
#include "core.h"
#include "pub_core_libcassert.h"
+#include "pub_core_libcfile.h"
#include "priv_sema.h"
=20
/*=20
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-04 19:36:34 UTC (=
rev 3843)
+++ trunk/coregrind/m_syscalls/syscalls-linux.c 2005-06-04 20:03:55 UTC (=
rev 3844)
@@ -31,6 +31,7 @@
#include "core.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_libcassert.h"
+#include "pub_core_libcfile.h"
#include "pub_core_libcprint.h"
#include "pub_core_tooliface.h"
#include "priv_syscalls.h"
Modified: trunk/coregrind/m_syscalls/syscalls.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.c 2005-06-04 19:36:34 UTC (rev 38=
43)
+++ trunk/coregrind/m_syscalls/syscalls.c 2005-06-04 20:03:55 UTC (rev 38=
44)
@@ -33,6 +33,7 @@
#include "pub_core_aspacemgr.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
+#include "pub_core_libcfile.h"
#include "pub_core_libcprint.h"
#include "pub_core_main.h"
#include "pub_core_profile.h"
Added: 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-04 19:36:34 UTC (rev 3843=
)
+++ trunk/coregrind/pub_core_libcfile.h 2005-06-04 20:03:55 UTC (rev 3844=
)
@@ -0,0 +1,55 @@
+
+/*--------------------------------------------------------------------*/
+/*--- File/socket-related libc stuff. pub_core_libcfile.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_LIBCFILE_H
+#define __PUB_CORE_LIBCFILE_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module contains all the libc code that relates to
+// files and sockets: opening, reading, writing, etc.
+//--------------------------------------------------------------------
+
+#include "pub_tool_libcfile.h"
+
+/* Move an fd into the Valgrind-safe range */
+extern Int VG_(safe_fd)(Int oldfd);
+
+extern Int VG_(write_socket)( Int sd, void *msg, Int count );
+extern Int VG_(connect_via_socket)( UChar* str );
+extern Int VG_(getsockname) ( Int sd, struct vki_sockaddr *name, Int *na=
melen );
+extern Int VG_(getpeername) ( Int sd, struct vki_sockaddr *name, Int *na=
melen );
+extern Int VG_(getsockopt) ( Int sd, Int level, Int optname, void *optv=
al,
+ Int *optlen );
+
+#endif // __PUB_CORE_LIBCFILE_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/vg_mylibc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_mylibc.c 2005-06-04 19:36:34 UTC (rev 3843)
+++ trunk/coregrind/vg_mylibc.c 2005-06-04 20:03:55 UTC (rev 3844)
@@ -439,142 +439,6 @@
}
=20
/* ---------------------------------------------------------------------
- Primitive support for reading files.
- ------------------------------------------------------------------ */
-
-static inline Bool fd_exists(Int fd)
-{
- struct vki_stat st;
-
- return VG_(fstat)(fd, &st) =3D=3D 0;
-}
-
-/* Move an fd into the Valgrind-safe range */
-Int VG_(safe_fd)(Int oldfd)
-{
- Int newfd;
-
- vg_assert(VG_(fd_hard_limit) !=3D -1);
-
- newfd =3D VG_(fcntl)(oldfd, VKI_F_DUPFD, VG_(fd_hard_limit));
- if (newfd !=3D -1)
- VG_(close)(oldfd);
-
- VG_(fcntl)(newfd, VKI_F_SETFD, VKI_FD_CLOEXEC);
-
- vg_assert(newfd >=3D VG_(fd_hard_limit));
- return newfd;
-}
-
-
-
-/* Returns -1 on failure. */
-Int VG_(open) ( const Char* pathname, Int flags, Int mode )
-{ =20
- Int fd =3D VG_(do_syscall3)(__NR_open, (UWord)pathname, flags, mode);
- return fd;
-}
-
-Int VG_(pipe) ( Int fd[2] )
-{
- Int ret =3D VG_(do_syscall1)(__NR_pipe, (UWord)fd);
- return VG_(is_kerror)(ret) ? -1 : 0;
-}
-
-void VG_(close) ( Int fd )
-{
- VG_(do_syscall1)(__NR_close, fd);
-}
-
-
-Int VG_(read) ( Int fd, void* buf, Int count)
-{
- Int res;
- res =3D VG_(do_syscall3)(__NR_read, fd, (UWord)buf, count);
- return res;
-}
-
-Int VG_(write) ( Int fd, const void* buf, Int count)
-{
- Int res;
- res =3D VG_(do_syscall3)(__NR_write, fd, (UWord)buf, count);
- return res;
-}
-
-OffT VG_(lseek) ( Int fd, OffT offset, Int whence)
-{
- Int res;
- res =3D VG_(do_syscall3)(__NR_lseek, fd, offset, whence);
- if (VG_(is_kerror)(res)) res =3D -1;
- return res;
-}
-
-Int VG_(stat) ( Char* file_name, struct vki_stat* buf )
-{
- Int res;
- res =3D VG_(do_syscall2)(__NR_stat, (UWord)file_name, (UWord)buf);
- return res; /* return -ve error */
-}
-
-Int VG_(fstat) ( Int fd, struct vki_stat* buf )
-{
- Int res;
- res =3D VG_(do_syscall2)(__NR_fstat, fd, (UWord)buf);
- return VG_(is_kerror)(res) ? (-1) : 0;
-}
-
-Int VG_(dup2) ( Int oldfd, Int newfd )
-{
- Int res;
- res =3D VG_(do_syscall2)(__NR_dup2, oldfd, newfd);
- return VG_(is_kerror)(res) ? (-1) : res;
-}
-
-Int VG_(rename) ( Char* old_name, Char* new_name )
-{
- Int res;
- res =3D VG_(do_syscall2)(__NR_rename, (UWord)old_name, (UWord)new_nam=
e);
- return VG_(is_kerror)(res) ? (-1) : 0;
-}
-
-Int VG_(unlink) ( Char* file_name )
-{
- Int res;
- res =3D VG_(do_syscall1)(__NR_unlink, (UWord)file_name);
- return VG_(is_kerror)(res) ? (-1) : 0;
-}
-
-/* Nb: we do not allow the Linux extension which malloc()s memory for th=
e
- buffer if buf=3D=3DNULL, because we don't want Linux calling malloc()=
*/
-Char* VG_(getcwd) ( Char* buf, SizeT size )
-{
- Word res;
- vg_assert(buf !=3D NULL);
- res =3D VG_(do_syscall2)(__NR_getcwd, (UWord)buf, size);
- return VG_(is_kerror)(res) ? ((Char*)NULL) : (Char*)res;
-}
-
-/* Alternative version that does allocate the memory. Easier to use. */
-Bool VG_(getcwd_alloc) ( Char** out )
-{
- SizeT size =3D 4;
-
- *out =3D NULL;
- while (True) {
- *out =3D VG_(malloc)(size);
- if (NULL =3D=3D VG_(getcwd)(*out, size)) {
- VG_(free)(*out);
- if (size > 65535)
- return False;
- size *=3D 2;
- } else {
- return True;
- }
- }
-}
-
-
-/* ---------------------------------------------------------------------
Misc functions looking for a proper home.
------------------------------------------------------------------ */
=20
@@ -702,26 +566,6 @@
}
=20
=20
-/* Support for getdents. */
-Int VG_(getdents) (UInt fd, struct vki_dirent *dirp, UInt count)
-{
- Int res;
- /* res =3D getdents( fd, dirp, count ); */
- res =3D VG_(do_syscall3)(__NR_getdents, fd, (UWord)dirp, count);
- if (VG_(is_kerror)(res)) res =3D -1;
- return res;
-}
-
-/* Support for a readlink. */
-Int VG_(readlink) (Char* path, Char* buf, UInt bufsiz)
-{
- Int res;
- /* res =3D readlink( path, buf, bufsiz ); */
- res =3D VG_(do_syscall3)(__NR_readlink, (UWord)path, (UWord)buf, bufs=
iz);
- if (VG_(is_kerror)(res)) res =3D -1;
- return res;
-}
-
/* You'd be amazed how many places need to know the current pid. */
Int VG_(getpid) ( void )
{
@@ -951,259 +795,6 @@
VG_(exit)(1);
}
=20
-/* ---------------------------------------------------------------------
- Gruesome hackery for connecting to a logging server over the network.
- This is all very Linux-kernel specific.
- ------------------------------------------------------------------ */
-
-static
-Int parse_inet_addr_and_port ( UChar* str, UInt* ip_addr, UShort* port )=
;
-
-static
-Int my_socket ( Int domain, Int type, Int protocol );
-
-static
-Int my_connect ( Int sockfd, struct vki_sockaddr_in* serv_addr,=20
- Int addrlen );
-
-static=20
-UInt my_htonl ( UInt x )
-{
- return
- (((x >> 24) & 0xFF) << 0) | (((x >> 16) & 0xFF) << 8)
- | (((x >> 8) & 0xFF) << 16) | (((x >> 0) & 0xFF) << 24);
-}
-
-static
-UShort my_htons ( UShort x )
-{
- return
- (((x >> 8) & 0xFF) << 0) | (((x >> 0) & 0xFF) << 8);
-}
-
-
-/* The main function.=20
-
- Supplied string contains either an ip address "192.168.0.1" or
- an ip address and port pair, "192.168.0.1:1500". Parse these,
- and return:
- -1 if there is a parse error
- -2 if no parse error, but specified host:port cannot be opened
- the relevant file (socket) descriptor, otherwise.
- is used.
-*/
-Int VG_(connect_via_socket)( UChar* str )
-{
- Int sd, res;
- struct vki_sockaddr_in servAddr;
- UInt ip =3D 0;
- UShort port =3D VG_CLO_DEFAULT_LOGPORT;
- Bool ok =3D parse_inet_addr_and_port(str, &ip, &port);
- if (!ok)=20
- return -1;
-
- if (0)
- VG_(printf)("ip =3D %d.%d.%d.%d, port %d\n",
- (ip >> 24) & 0xFF, (ip >> 16) & 0xFF,=20
- (ip >> 8) & 0xFF, ip & 0xFF,=20
- (UInt)port );
-
- servAddr.sin_family =3D VKI_AF_INET;
- servAddr.sin_addr.s_addr =3D my_htonl(ip);
- servAddr.sin_port =3D my_htons(port);
-
- /* create socket */
- sd =3D my_socket(VKI_AF_INET, VKI_SOCK_STREAM, 0 /* IPPROTO_IP ? */);
- if (sd < 0) {
- /* this shouldn't happen ... nevertheless */
- return -2;
- }
- =09
- /* connect to server */
- res =3D my_connect(sd, (struct vki_sockaddr_in *) &servAddr,=20
- sizeof(servAddr));
- if (res < 0) {
- /* connection failed */
- return -2;
- }
-
- return sd;
-}
-
-
-/* Let d =3D one or more digits. Accept either:
- d.d.d.d or d.d.d.d:d
-*/
-Int parse_inet_addr_and_port ( UChar* str, UInt* ip_addr, UShort* port )
-{
-# define GET_CH ((*str) ? (*str++) : 0)
- UInt ipa, i, j, c, any;
- ipa =3D 0;
- for (i =3D 0; i < 4; i++) {
- j =3D 0;
- any =3D 0;
- while (1) {
- c =3D GET_CH;=20
- if (c < '0' || c > '9') break;
- j =3D 10 * j + (int)(c - '0');
- any =3D 1;
- }
- if (any =3D=3D 0 || j > 255) goto syntaxerr;
- ipa =3D (ipa << 8) + j;
- if (i <=3D 2 && c !=3D '.') goto syntaxerr;
- }
- if (c =3D=3D 0 || c =3D=3D ':')=20
- *ip_addr =3D ipa;
- if (c =3D=3D 0) goto ok;
- if (c !=3D ':') goto syntaxerr;
- j =3D 0;
- any =3D 0;
- while (1) {
- c =3D GET_CH;=20
- if (c < '0' || c > '9') break;
- j =3D j * 10 + (int)(c - '0');
- any =3D 1;
- if (j > 65535) goto syntaxerr;
- }
- if (any =3D=3D 0 || c !=3D 0) goto syntaxerr;
- if (j < 1024) goto syntaxerr;
- *port =3D (UShort)j;
- ok:
- return 1;
- syntaxerr:
- return 0;
-# undef GET_CH
-}
-
-
-static
-Int my_socket ( Int domain, Int type, Int protocol )
-{
-// AMD64/Linux doesn't define __NR_socketcall... see comment above
-// VG_(sigpending)() for more details.
-#ifdef __amd64__
- I_die_here;
-#else
- Int res;
- UWord args[3];
- args[0] =3D domain;
- args[1] =3D type;
- args[2] =3D protocol;
- res =3D VG_(do_syscall2)(__NR_socketcall, VKI_SYS_SOCKET, (UWord)&arg=
s);
- if (VG_(is_kerror)(res))=20
- res =3D -1;
- return res;
-#endif
-}
-
-static
-Int my_connect ( Int sockfd, struct vki_sockaddr_in* serv_addr,=20
- Int addrlen )
-{
-// AMD64/Linux doesn't define __NR_socketcall... see comment above
-// VG_(sigpending)() for more details.
-#ifdef __amd64__
- I_die_here;
-#else
- Int res;
- UWord args[3];
- args[0] =3D sockfd;
- args[1] =3D (UWord)serv_addr;
- args[2] =3D addrlen;
- res =3D VG_(do_syscall2)(__NR_socketcall, VKI_SYS_CONNECT, (UWord)&ar=
gs);
- if (VG_(is_kerror)(res))=20
- res =3D -1;
- return res;
-#endif
-}
-
-Int VG_(write_socket)( Int sd, void *msg, Int count )
-{
-// AMD64/Linux doesn't define __NR_socketcall... see comment above
-// VG_(sigpending)() for more details.
-#ifdef __amd64__
- I_die_here;
-#else
- /* This is actually send(). */
-
- /* Requests not to send SIGPIPE on errors on stream oriented
- sockets when the other end breaks the connection. The EPIPE
- error is still returned. */
- Int flags =3D VKI_MSG_NOSIGNAL;
-
- Int res;
- UWord args[4];
- args[0] =3D sd;
- args[1] =3D (UWord)msg;
- args[2] =3D count;
- args[3] =3D flags;
- res =3D VG_(do_syscall2)(__NR_socketcall, VKI_SYS_SEND, (UWord)&args)=
;
- if (VG_(is_kerror)(res))=20
- res =3D -1;
- return res;
-#endif
-}
-
-Int VG_(getsockname) ( Int sd, struct vki_sockaddr *name, Int *namelen)
-{
-// AMD64/Linux doesn't define __NR_socketcall... see comment above
-// VG_(sigpending)() for more details.
-#ifdef __amd64__
- I_die_here;
-#else
- Int res;
- UWord args[3];
- args[0] =3D sd;
- args[1] =3D (UWord)name;
- args[2] =3D (UWord)namelen;
- res =3D VG_(do_syscall2)(__NR_socketcall, VKI_SYS_GETSOCKNAME, (UWord=
)&args);
- if(VG_(is_kerror)(res))
- res =3D -1;
- return res;
-#endif
-}
-
-Int VG_(getpeername) ( Int sd, struct vki_sockaddr *name, Int *namelen)
-{
-// AMD64/Linux doesn't define __NR_socketcall... see comment above
-// VG_(sigpending)() for more details.
-#ifdef __amd64__
- I_die_here;
-#else
- Int res;
- UWord args[3];
- args[0] =3D sd;
- args[1] =3D (UWord)name;
- args[2] =3D (UWord)namelen;
- res =3D VG_(do_syscall2)(__NR_socketcall, VKI_SYS_GETPEERNAME, (UWord=
)&args);
- if(VG_(is_kerror)(res))
- res =3D -1;
- return res;
-#endif
-}
-
-Int VG_(getsockopt) ( Int sd, Int level, Int optname, void *optval,
- Int *optlen)
-{
-// AMD64/Linux doesn't define __NR_socketcall... see comment above
-// VG_(sigpending)() for more details.
-#ifdef __amd64__
- I_die_here;
-#else
- Int res;
- UWord args[5];
- args[0] =3D sd;
- args[1] =3D level;
- args[2] =3D optname;
- args[3] =3D (UWord)optval;
- args[4] =3D (UWord)optlen;
- res =3D VG_(do_syscall2)(__NR_socketcall, VKI_SYS_GETSOCKOPT, (UWord)=
&args);
- if(VG_(is_kerror)(res))
- res =3D -1;
- return res;
-#endif
-}
-
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
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-04 19:36:34 UTC (rev 3843)
+++ trunk/include/Makefile.am 2005-06-04 20:03:55 UTC (rev 3844)
@@ -10,6 +10,7 @@
pub_tool_hashtable.h \
pub_tool_libcbase.h \
pub_tool_libcassert.h \
+ pub_tool_libcfile.h \
pub_tool_libcprint.h \
pub_tool_mallocfree.h \
pub_tool_options.h \
Added: trunk/include/pub_tool_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/include/pub_tool_libcfile.h 2005-06-04 19:36:34 UTC (rev 3843)
+++ trunk/include/pub_tool_libcfile.h 2005-06-04 20:03:55 UTC (rev 3844)
@@ -0,0 +1,65 @@
+
+/*--------------------------------------------------------------------*/
+/*--- File/socket-related libc stuff. pub_tool_libcfile.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_LIBCFILE_H
+#define __PUB_TOOL_LIBCFILE_H
+
+/* ---------------------------------------------------------------------
+ File-related functions.
+ ------------------------------------------------------------------ */
+
+extern Int VG_(open) ( const Char* pathname, Int flags, Int mode );
+extern void VG_(close) ( Int fd );
+extern Int VG_(read) ( Int fd, void* buf, Int count);
+extern Int VG_(write) ( Int fd, const void* buf, Int count);
+extern Int VG_(pipe) ( Int fd[2] );
+extern OffT VG_(lseek) ( Int fd, OffT offset, Int whence);
+
+extern Int VG_(stat) ( Char* file_name, struct vki_stat* buf );
+extern Int VG_(fstat) ( Int fd, struct vki_stat* buf );
+extern Int VG_(dup2) ( Int oldfd, Int newfd );
+extern Int VG_(rename) ( Char* old_name, Char* new_name );
+extern Int VG_(unlink) ( Char* file_name );
+
+extern Char* VG_(getcwd) ( Char* buf, SizeT size );
+
+/* Easier to use than VG_(getcwd)() -- does the buffer fiddling itself.
+ String put into 'cwd' is VG_(malloc)'d, and should be VG_(free)'d.
+ Returns False if it fails. Will fail if the pathname is > 65535 byte=
s. */
+extern Bool VG_(getcwd_alloc) ( Char** cwd );
+
+extern Int VG_(readlink)( Char* path, Char* buf, UInt bufsize );
+extern Int VG_(getdents)( UInt fd, struct vki_dirent *dirp, UInt count =
);
+
+#endif // __PUB_TOOL_LIBCFILE_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-04 19:36:34 UTC (rev 3843)
+++ trunk/include/tool.h 2005-06-04 20:03:55 UTC (rev 3844)
@@ -112,11 +112,6 @@
#endif
=20
/* ------------------------------------------------------------------ */
-/* stdio.h */
-
-extern Int VG_(rename) ( Char* old_name, Char* new_name );
-
-/* ------------------------------------------------------------------ */
/* stdlib.h */
=20
/* terminate everything */
@@ -142,35 +137,12 @@
=20
/* ------------------------------------------------------------------ */
/* unistd.h, fcntl.h, sys/stat.h */
-extern Int VG_(getdents)( UInt fd, struct vki_dirent *dirp, UInt count =
);
-extern Int VG_(readlink)( Char* path, Char* buf, UInt bufsize );
extern Int VG_(getpid) ( void );
extern Int VG_(getppid) ( void );
extern Int VG_(getpgrp) ( void );
extern Int VG_(gettid) ( void );
extern Int VG_(setpgid) ( Int pid, Int pgrp );
=20
-extern Int VG_(open) ( const Char* pathname, Int flags, Int mode );
-extern Int VG_(read) ( Int fd, void* buf, Int count);
-extern Int VG_(write) ( Int fd, const void* buf, Int count);
-extern OffT VG_(lseek) ( Int fd, OffT offset, Int whence);
-extern void VG_(close) ( Int fd );
-
-extern Int VG_(pipe) ( Int fd[2] );
-
-/* Nb: VG_(rename)() declared in stdio.h section above */
-extern Int VG_(unlink) ( Char* file_name );
-extern Int VG_(stat) ( Char* file_name, struct vki_stat* buf );
-extern Int VG_(fstat) ( Int fd, struct vki_stat* buf );
-extern Int VG_(dup2) ( Int oldfd, Int newfd );
-
-extern Char* VG_(getcwd) ( Char* buf, SizeT size );
-
-/* Easier to use than VG_(getcwd)() -- does the buffer fiddling itself.
- String put into 'cwd' is VG_(malloc)'d, and should be VG_(free)'d.
- Returns False if it fails. Will fail if the pathname is > 65535 byte=
s. */
-extern Bool VG_(getcwd_alloc) ( Char** cwd );
-
/* ------------------------------------------------------------------ */
/* Get memory by anonymous mmap. */
extern void* VG_(get_memory_from_mmap) ( SizeT nBytes, Char* who );
@@ -248,14 +220,6 @@
extern Int VG_(waitpid) ( Int pid, Int *status, Int options );
=20
/* ------------------------------------------------------------------ */
-/* socket.h. */
-
-extern Int VG_(getsockname) ( Int sd, struct vki_sockaddr *name, Int *na=
melen);
-extern Int VG_(getpeername) ( Int sd, struct vki_sockaddr *name, Int *na=
melen);
-extern Int VG_(getsockopt) ( Int sd, Int level, Int optname, void *optva=
l,
- Int *optlen);
-
-/* ------------------------------------------------------------------ */
/* other, randomly useful functions */
extern UInt VG_(read_millisecond_timer) ( void );
=20
Modified: trunk/massif/ms_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/massif/ms_main.c 2005-06-04 19:36:34 UTC (rev 3843)
+++ trunk/massif/ms_main.c 2005-06-04 20:03:55 UTC (rev 3844)
@@ -39,6 +39,7 @@
#include "pub_tool_hashtable.h"
#include "pub_tool_libcbase.h"
#include "pub_tool_libcassert.h"
+#include "pub_tool_libcfile.h"
#include "pub_tool_libcprint.h"
#include "pub_tool_mallocfree.h"
#include "pub_tool_options.h"
|
|
From: <sv...@va...> - 2005-06-04 19:36:42
|
Author: rjwalsh Date: 2005-06-04 20:36:34 +0100 (Sat, 04 Jun 2005) New Revision: 3843 Modified: trunk/coregrind/m_debuginfo/ trunk/coregrind/m_scheduler/ Log: Update ignores. Property changes on: trunk/coregrind/m_debuginfo ___________________________________________________________________ Name: svn:ignore + *.a .deps Makefile Makefile.in Property changes on: trunk/coregrind/m_scheduler ___________________________________________________________________ Name: svn:ignore + *.a .deps Makefile Makefile.in |
|
From: <sv...@va...> - 2005-06-04 19:16:11
|
Author: njn
Date: 2005-06-04 20:16:06 +0100 (Sat, 04 Jun 2005)
New Revision: 3842
Added:
trunk/coregrind/m_libcassert.c
trunk/coregrind/pub_core_libcassert.h
trunk/include/pub_tool_libcassert.h
Modified:
trunk/cachegrind/cg_main.c
trunk/coregrind/Makefile.am
trunk/coregrind/amd64/state.c
trunk/coregrind/core.h
trunk/coregrind/linux/core_os.c
trunk/coregrind/m_aspacemgr/aspacemgr.c
trunk/coregrind/m_aspacemgr/read_procselfmaps.c
trunk/coregrind/m_debuginfo/dwarf.c
trunk/coregrind/m_debuginfo/stabs.c
trunk/coregrind/m_debuginfo/symtab.c
trunk/coregrind/m_debuginfo/symtypes.c
trunk/coregrind/m_demangle/cp-demangle.c
trunk/coregrind/m_demangle/cplus-dem.c
trunk/coregrind/m_demangle/dyn-string.c
trunk/coregrind/m_errormgr.c
trunk/coregrind/m_execontext.c
trunk/coregrind/m_hashtable.c
trunk/coregrind/m_libcprint.c
trunk/coregrind/m_main.c
trunk/coregrind/m_mallocfree.c
trunk/coregrind/m_profile.c
trunk/coregrind/m_redir.c
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_scheduler/sema.c
trunk/coregrind/m_sigframe/sigframe-amd64-linux.c
trunk/coregrind/m_sigframe/sigframe-x86-linux.c
trunk/coregrind/m_signals.c
trunk/coregrind/m_skiplist.c
trunk/coregrind/m_stacktrace.c
trunk/coregrind/m_syscalls/syscalls-amd64-linux.c
trunk/coregrind/m_syscalls/syscalls-linux.c
trunk/coregrind/m_syscalls/syscalls-x86-linux.c
trunk/coregrind/m_syscalls/syscalls.c
trunk/coregrind/m_tooliface.c
trunk/coregrind/m_translate.c
trunk/coregrind/m_transtab.c
trunk/coregrind/vg_mylibc.c
trunk/coregrind/x86/state.c
trunk/helgrind/hg_main.c
trunk/include/Makefile.am
trunk/include/tool.h
trunk/massif/ms_main.c
trunk/memcheck/mac_leakcheck.c
trunk/memcheck/mac_malloc_wrappers.c
trunk/memcheck/mac_shared.c
trunk/memcheck/mc_main.c
trunk/memcheck/mc_translate.c
Log:
Modularised assertions and panics in m_libcassert.
As part of this, killed the VG_STRINGIFY macro, which was used to expand
out names like "VG_(foo)" and "vgPlain_foo" in assertion failure
messages. This is good since we actually want the "VG_(foo)" form used
in these messages.
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-03 13:21:18 UTC (rev 3841)
+++ trunk/cachegrind/cg_main.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -33,6 +33,7 @@
#include "pub_tool_debuginfo.h"
#include "pub_tool_hashtable.h"
#include "pub_tool_libcbase.h"
+#include "pub_tool_libcassert.h"
#include "pub_tool_libcprint.h"
#include "pub_tool_mallocfree.h"
#include "pub_tool_options.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-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/Makefile.am 2005-06-04 19:16:06 UTC (rev 3842)
@@ -47,6 +47,7 @@
pub_core_execontext.h \
pub_core_hashtable.h \
pub_core_libcbase.h \
+ pub_core_libcassert.h \
pub_core_libcprint.h \
pub_core_main.h \
pub_core_mallocfree.h \
@@ -90,6 +91,7 @@
m_execontext.c \
m_hashtable.c \
m_libcbase.c \
+ m_libcassert.c \
m_libcprint.c \
m_main.c \
m_mallocfree.c \
Modified: trunk/coregrind/amd64/state.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/amd64/state.c 2005-06-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/amd64/state.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -30,6 +30,7 @@
=20
#include "core.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "pub_core_tooliface.h"
#include <sys/ptrace.h>
=20
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-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/core.h 2005-06-04 19:16:06 UTC (rev 3842)
@@ -96,38 +96,6 @@
Exports of vg_mylibc.c
------------------------------------------------------------------ */
=20
-// Useful for making failing stubs, when certain things haven't yet been
-// implemented.
-#define I_die_here \
- VG_(assert_fail) (/*isCore*//*BOGUS*/True, \
- "Unimplemented functionality", \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, \
- "valgrind", VG_BUGS_TO, "")
-
-#define vg_assert(expr) =
\
- ((void) ((expr) ? 0 : =
\
- (VG_(assert_fail) (/*isCore*/True, VG_STRINGIFY(expr), =
\
- __FILE__, __LINE__, __PRETTY_FUNCTION__, =
\
- ""), =
\
- 0)))
-
-#define vg_assert2(expr, format, args...) =
\
- ((void) ((expr) ? 0 : =
\
- (VG_(assert_fail) (/*isCore*/True, VG_STRINGIFY(expr), =
\
- __FILE__, __LINE__, __PRETTY_FUNCTION__, =
\
- format, ##args), =
\
- 0)))
-
-__attribute__ ((__noreturn__))
-extern void VG_(core_panic) ( Char* str );
-__attribute__ ((__noreturn__))
-extern void VG_(core_panic_at) ( Char* str, Addr ip, Addr sp, Addr fp=
);
-
-/* Called when some unhandleable client behaviour is detected.
- Prints a msg and aborts. */
-extern void VG_(unimplemented) ( Char* msg )
- __attribute__((__noreturn__));
-
/* Tools use VG_(strdup)() which doesn't expose ArenaId */
extern Char* VG_(arena_strdup) ( ArenaId aid, const Char* s);
=20
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-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/linux/core_os.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -30,6 +30,7 @@
=20
#include "core.h"
#include "pub_core_debuglog.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.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-03 13:21:18 UTC (rev =
3841)
+++ trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-06-04 19:16:06 UTC (rev =
3842)
@@ -33,6 +33,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_options.h"
#include "pub_core_syscalls.h"
Modified: trunk/coregrind/m_aspacemgr/read_procselfmaps.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/read_procselfmaps.c 2005-06-03 13:21:18 U=
TC (rev 3841)
+++ trunk/coregrind/m_aspacemgr/read_procselfmaps.c 2005-06-04 19:16:06 U=
TC (rev 3842)
@@ -33,6 +33,7 @@
#include "core.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
=20
/* Size of a smallish table used to read /proc/self/map entries. */
Modified: trunk/coregrind/m_debuginfo/dwarf.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_debuginfo/dwarf.c 2005-06-03 13:21:18 UTC (rev 3841=
)
+++ trunk/coregrind/m_debuginfo/dwarf.c 2005-06-04 19:16:06 UTC (rev 3842=
)
@@ -30,6 +30,7 @@
=20
#include "core.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_options.h"
#include "priv_symtab.h"
Modified: trunk/coregrind/m_debuginfo/stabs.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_debuginfo/stabs.c 2005-06-03 13:21:18 UTC (rev 3841=
)
+++ trunk/coregrind/m_debuginfo/stabs.c 2005-06-04 19:16:06 UTC (rev 3842=
)
@@ -30,6 +30,7 @@
=20
#include "core.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "priv_symtab.h"
=20
Modified: trunk/coregrind/m_debuginfo/symtab.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_debuginfo/symtab.c 2005-06-03 13:21:18 UTC (rev 384=
1)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-06-04 19:16:06 UTC (rev 384=
2)
@@ -33,6 +33,7 @@
#include "pub_core_aspacemgr.h"
#include "pub_core_demangle.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_options.h"
#include "pub_core_profile.h"
Modified: trunk/coregrind/m_debuginfo/symtypes.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuginfo/symtypes.c 2005-06-03 13:21:18 UTC (rev 3=
841)
+++ trunk/coregrind/m_debuginfo/symtypes.c 2005-06-04 19:16:06 UTC (rev 3=
842)
@@ -32,6 +32,7 @@
#include "pub_core_debuginfo.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_tooliface.h"
#include "priv_symtypes.h"
Modified: trunk/coregrind/m_demangle/cp-demangle.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_demangle/cp-demangle.c 2005-06-03 13:21:18 UTC (rev=
3841)
+++ trunk/coregrind/m_demangle/cp-demangle.c 2005-06-04 19:16:06 UTC (rev=
3842)
@@ -42,6 +42,7 @@
=20
#include "core.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "ansidecl.h"
#include "dyn-string.h"
#include "demangle.h"
Modified: trunk/coregrind/m_demangle/cplus-dem.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_demangle/cplus-dem.c 2005-06-03 13:21:18 UTC (rev 3=
841)
+++ trunk/coregrind/m_demangle/cplus-dem.c 2005-06-04 19:16:06 UTC (rev 3=
842)
@@ -39,6 +39,7 @@
#include "safe-ctype.h"
#include "core.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "pub_tool_libcprint.h"
=20
/*#include <sys/types.h>
Modified: trunk/coregrind/m_demangle/dyn-string.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_demangle/dyn-string.c 2005-06-03 13:21:18 UTC (rev =
3841)
+++ trunk/coregrind/m_demangle/dyn-string.c 2005-06-04 19:16:06 UTC (rev =
3842)
@@ -33,6 +33,7 @@
=20
#include "core.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "ansidecl.h"
#include "dyn-string.h"
=20
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-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/m_errormgr.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -33,6 +33,7 @@
#include "pub_core_errormgr.h"
#include "pub_core_execontext.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_main.h" // for VG_(start_debugger)()
#include "pub_core_options.h"
Modified: trunk/coregrind/m_execontext.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_execontext.c 2005-06-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/m_execontext.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -30,6 +30,7 @@
=20
#include "core.h"
#include "pub_core_execontext.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_options.h"
#include "pub_core_profile.h"
Modified: trunk/coregrind/m_hashtable.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_hashtable.c 2005-06-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/m_hashtable.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -30,6 +30,7 @@
=20
#include "core.h"
#include "pub_core_hashtable.h"
+#include "pub_core_libcassert.h"
=20
/*--------------------------------------------------------------------*/
/*--- Declarations ---*/
Added: 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-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/m_libcassert.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -0,0 +1,194 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Assertions and panics. m_libcassert.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_main.h"
+#include "pub_core_stacktrace.h"
+#include "pub_core_tooliface.h"
+
+/* ---------------------------------------------------------------------
+ Assertery.
+ ------------------------------------------------------------------ */
+
+#if defined(VGP_x86_linux)
+# define GET_REAL_SP_AND_FP(sp, fp) \
+ asm("movl %%esp, %0;" \
+ "movl %%ebp, %1;" \
+ : "=3Dr" (sp),\
+ "=3Dr" (fp));
+#elif defined(VGP_amd64_linux)
+# define GET_REAL_SP_AND_FP(sp, fp) \
+ asm("movq %%rsp, %0;" \
+ "movq %%rbp, %1;" \
+ : "=3Dr" (sp),\
+ "=3Dr" (fp));
+#else
+# error Unknown platform
+#endif
+
+__attribute__ ((noreturn))
+static void report_and_quit ( const Char* report, Addr ip, Addr sp, Addr=
fp )
+{
+ #define BACKTRACE_DEPTH 100 // nice and deep!
+ Addr stacktop, ips[BACKTRACE_DEPTH];
+ ThreadState *tst;
+
+ tst =3D VG_(get_ThreadState)( VG_(get_lwp_tid)(VG_(gettid)()) );
+
+ // If necessary, fake up an ExeContext which is of our actual real CP=
U
+ // state. Could cause problems if we got the panic/exception within =
the
+ // execontext/stack dump/symtab code. But it's better than nothing.
+ if (0 =3D=3D ip && 0 =3D=3D sp && 0 =3D=3D fp) {
+ ip =3D (Addr)__builtin_return_address(0);
+ GET_REAL_SP_AND_FP(sp, fp);
+ }
+
+ stacktop =3D tst->os_state.valgrind_stack_base +=20
+ tst->os_state.valgrind_stack_szB;
+
+ VG_(get_StackTrace2)(ips, BACKTRACE_DEPTH, ip, sp, fp, sp, stacktop);
+ VG_(pp_StackTrace) (ips, BACKTRACE_DEPTH);
+
+ VG_(printf)("\nBasic block ctr is approximately %llu\n", VG_(bbs_done=
) );
+
+ VG_(pp_sched_status)();
+ VG_(printf)("\n");
+ VG_(printf)("Note: see also the FAQ.txt in the source distribution.\n=
");
+ VG_(printf)("It contains workarounds to several common problems.\n");
+ VG_(printf)("\n");
+ VG_(printf)("If that doesn't help, please report this bug to: %s\n\n"=
,=20
+ report);
+ VG_(printf)("In the bug report, send all the above text, the valgrind=
\n");
+ VG_(printf)("version, and what Linux distro you are using. Thanks.\n=
\n");
+ VG_(exit)(1);
+
+ #undef BACKTRACE_DEPTH
+}
+
+void VG_(assert_fail) ( Bool isCore, const Char* expr, const Char* file,=
=20
+ Int line, const Char* fn, const HChar* format, .=
.. )
+{
+ va_list vargs;
+ Char buf[256];
+ Char* bufptr =3D buf;
+ Char* component;
+ Char* bugs_to;
+
+ static Bool entered =3D False;
+ if (entered)=20
+ VG_(exit)(2);
+ entered =3D True;
+
+ va_start(vargs, format);
+ VG_(vsprintf) ( bufptr, format, vargs );
+ va_end(vargs);
+
+ if (isCore) {
+ component =3D "valgrind";
+ bugs_to =3D VG_BUGS_TO;
+ } else {=20
+ component =3D VG_(details).name;
+ bugs_to =3D VG_(details).bug_reports_to;
+ }
+
+ // Treat vg_assert2(0, "foo") specially, as a panicky abort
+ if (VG_STREQ(expr, "0")) {
+ VG_(printf)("\n%s: %s:%d (%s): the 'impossible' happened.\n",
+ component, file, line, fn, expr );
+ } else {
+ VG_(printf)("\n%s: %s:%d (%s): Assertion '%s' failed.\n",
+ component, file, line, fn, expr );
+ }
+ if (!VG_STREQ(buf, ""))
+ VG_(printf)("%s: %s\n", component, buf );
+
+ report_and_quit(bugs_to, 0,0,0);
+}
+
+__attribute__ ((noreturn))
+static void panic ( Char* name, Char* report, Char* str,
+ Addr ip, Addr sp, Addr fp )
+{
+ VG_(printf)("\n%s: the 'impossible' happened:\n %s\n", name, str);
+ report_and_quit(report, ip, sp, fp);
+}
+
+void VG_(core_panic_at) ( Char* str, Addr ip, Addr sp, Addr fp )
+{
+ panic("valgrind", VG_BUGS_TO, str, ip, sp, fp);
+}
+
+void VG_(core_panic) ( Char* str )
+{
+ VG_(core_panic_at)(str, 0,0,0);
+}
+
+void VG_(tool_panic) ( Char* str )
+{
+ panic(VG_(details).name, VG_(details).bug_reports_to, str, 0,0,0);
+}
+
+/* Print some helpful-ish text about unimplemented things, and give
+ up. */
+void VG_(unimplemented) ( Char* msg )
+{
+ VG_(message)(Vg_UserMsg, "");
+ VG_(message)(Vg_UserMsg,=20
+ "Valgrind detected that your program requires");
+ VG_(message)(Vg_UserMsg,=20
+ "the following unimplemented functionality:");
+ VG_(message)(Vg_UserMsg, " %s", msg);
+ VG_(message)(Vg_UserMsg,
+ "This may be because the functionality is hard to implement,");
+ VG_(message)(Vg_UserMsg,
+ "or because no reasonable program would behave this way,");
+ VG_(message)(Vg_UserMsg,
+ "or because nobody has yet needed it. In any case, let us know at=
");
+ VG_(message)(Vg_UserMsg,
+ "%s and/or try to work around the problem, if you can.", VG_BUGS_T=
O);
+ VG_(message)(Vg_UserMsg,
+ "");
+ VG_(message)(Vg_UserMsg,
+ "Valgrind has to exit now. Sorry. Bye!");
+ VG_(message)(Vg_UserMsg,
+ "");
+ VG_(pp_sched_status)();
+ VG_(exit)(1);
+}
+
+
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
+
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-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/m_libcprint.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -31,6 +31,7 @@
#include "core.h"
#include "pub_core_debuglog.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_options.h"
#include "valgrind.h" // for RUNNING_ON_VALGRIND
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-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/m_main.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -37,6 +37,7 @@
#include "pub_core_errormgr.h"
#include "pub_core_execontext.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_main.h"
#include "pub_core_options.h"
Modified: trunk/coregrind/m_mallocfree.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_mallocfree.c 2005-06-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/m_mallocfree.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -33,6 +33,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_options.h"
#include "pub_core_profile.h"
Modified: trunk/coregrind/m_profile.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_profile.c 2005-06-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/m_profile.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -29,6 +29,7 @@
*/
=20
#include "core.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_profile.h"
=20
Modified: trunk/coregrind/m_redir.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_redir.c 2005-06-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/m_redir.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -33,6 +33,7 @@
=20
#include "pub_core_aspacemgr.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_skiplist.h"
#include "pub_core_options.h"
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-03 13:21:18 UTC (rev =
3841)
+++ trunk/coregrind/m_scheduler/scheduler.c 2005-06-04 19:16:06 UTC (rev =
3842)
@@ -64,6 +64,7 @@
#include "pub_core_dispatch.h"
#include "pub_core_errormgr.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_main.h"
#include "pub_core_options.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-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/m_scheduler/sema.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -29,6 +29,7 @@
*/
=20
#include "core.h"
+#include "pub_core_libcassert.h"
#include "priv_sema.h"
=20
/*=20
Modified: trunk/coregrind/m_sigframe/sigframe-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_sigframe/sigframe-amd64-linux.c 2005-06-03 13:21:18=
UTC (rev 3841)
+++ trunk/coregrind/m_sigframe/sigframe-amd64-linux.c 2005-06-04 19:16:06=
UTC (rev 3842)
@@ -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_options.h"
#include "pub_core_sigframe.h"
Modified: trunk/coregrind/m_sigframe/sigframe-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_sigframe/sigframe-x86-linux.c 2005-06-03 13:21:18 U=
TC (rev 3841)
+++ trunk/coregrind/m_sigframe/sigframe-x86-linux.c 2005-06-04 19:16:06 U=
TC (rev 3842)
@@ -32,6 +32,7 @@
#include "core.h"
#include "pub_core_aspacemgr.h" /* find_segment */
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_options.h"
#include "pub_core_sigframe.h"
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-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/m_signals.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -84,6 +84,7 @@
#include "pub_core_aspacemgr.h"
#include "pub_core_errormgr.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_main.h"
#include "pub_core_options.h"
Modified: trunk/coregrind/m_skiplist.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_skiplist.c 2005-06-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/m_skiplist.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -88,6 +88,7 @@
=20
#include "core.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_skiplist.h"
=20
Modified: trunk/coregrind/m_stacktrace.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_stacktrace.c 2005-06-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/m_stacktrace.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -31,6 +31,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_options.h"
#include "pub_core_profile.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-03 13:21:18=
UTC (rev 3841)
+++ trunk/coregrind/m_syscalls/syscalls-amd64-linux.c 2005-06-04 19:16:06=
UTC (rev 3842)
@@ -32,6 +32,7 @@
#include "ume.h" /* for jmp_with_stack */
#include "pub_core_debuglog.h"
#include "pub_core_aspacemgr.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_sigframe.h"
#include "pub_core_syscalls.h"
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-03 13:21:18 UTC (=
rev 3841)
+++ trunk/coregrind/m_syscalls/syscalls-linux.c 2005-06-04 19:16:06 UTC (=
rev 3842)
@@ -30,6 +30,7 @@
=20
#include "core.h"
#include "pub_core_aspacemgr.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_tooliface.h"
#include "priv_syscalls.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-03 13:21:18 U=
TC (rev 3841)
+++ trunk/coregrind/m_syscalls/syscalls-x86-linux.c 2005-06-04 19:16:06 U=
TC (rev 3842)
@@ -37,6 +37,7 @@
#include "ume.h" /* for jmp_with_stack */
#include "pub_core_debuglog.h"
#include "pub_core_aspacemgr.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_sigframe.h"
#include "pub_core_syscalls.h"
Modified: trunk/coregrind/m_syscalls/syscalls.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.c 2005-06-03 13:21:18 UTC (rev 38=
41)
+++ trunk/coregrind/m_syscalls/syscalls.c 2005-06-04 19:16:06 UTC (rev 38=
42)
@@ -32,6 +32,7 @@
#include "pub_core_debuglog.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_main.h"
#include "pub_core_profile.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-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/m_tooliface.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -31,6 +31,7 @@
=20
#include "core.h"
#include "pub_core_tooliface.h"
+#include "pub_core_libcbase.h"
#include "pub_core_libcprint.h"
=20
// The core/tool dictionary of functions (initially zeroed, as we want i=
t)
@@ -100,11 +101,10 @@
/* static */
void VG_(sanity_check_needs) ( void)
{
-#define CHECK_NOT(var, value) \
- if ((var)=3D=3D(value)) { \
- VG_(printf)("\nTool error: '%s' not initialised\n", \
- VG_STRINGIFY(var)); \
- VG_(tool_panic)("Uninitialised details field\n"); \
+#define CHECK_NOT(var, value) \
+ if ((var)=3D=3D(value)) { \
+ VG_(printf)("\nTool error: '%s' not initialised\n", #var);\
+ VG_(tool_panic)("Uninitialised details field\n"); \
}
=20
/* Ones that must be set */
Modified: trunk/coregrind/m_translate.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_translate.c 2005-06-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/m_translate.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -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_main.h" // for VG_(bbs_done)
#include "pub_core_options.h"
Modified: trunk/coregrind/m_transtab.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_transtab.c 2005-06-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/m_transtab.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -32,6 +32,7 @@
#include "core.h"
#include "pub_core_debuginfo.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_options.h"
#include "pub_core_tooliface.h"
Added: trunk/coregrind/pub_core_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/coregrind/pub_core_libcassert.h 2005-06-03 13:21:18 UTC (rev 38=
41)
+++ trunk/coregrind/pub_core_libcassert.h 2005-06-04 19:16:06 UTC (rev 38=
42)
@@ -0,0 +1,77 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Assertions, etc. pub_core_libcassert.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_LIBCASSERT_H
+#define __PUB_CORE_LIBCASSERT_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module contains all the libc code related to assertions=
,
+// panics and aborting.
+//--------------------------------------------------------------------
+
+#include "pub_tool_libcassert.h"
+
+// Useful for making failing stubs, when certain things haven't yet been
+// implemented.
+#define I_die_here \
+ VG_(assert_fail) (/*isCore*//*BOGUS*/True, \
+ "Unimplemented functionality", \
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, \
+ "valgrind", VG_BUGS_TO, "")
+
+#define vg_assert(expr) =
\
+ ((void) ((expr) ? 0 : =
\
+ (VG_(assert_fail) (/*isCore*/True, #expr, =
\
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, =
\
+ ""), =
\
+ 0)))
+
+#define vg_assert2(expr, format, args...) =
\
+ ((void) ((expr) ? 0 : =
\
+ (VG_(assert_fail) (/*isCore*/True, #expr, =
\
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, =
\
+ format, ##args), =
\
+ 0)))
+
+__attribute__ ((__noreturn__))
+extern void VG_(core_panic) ( Char* str );
+__attribute__ ((__noreturn__))
+extern void VG_(core_panic_at) ( Char* str, Addr ip, Addr sp, Addr fp=
);
+
+/* Called when some unhandleable client behaviour is detected.
+ Prints a msg and aborts. */
+extern void VG_(unimplemented) ( Char* msg )
+ __attribute__((__noreturn__));
+
+#endif // __PUB_CORE_LIBCASSERT_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/vg_mylibc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_mylibc.c 2005-06-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/vg_mylibc.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -34,6 +34,7 @@
#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_main.h"
#include "pub_core_options.h"
@@ -438,157 +439,6 @@
}
=20
/* ---------------------------------------------------------------------
- Assertery.
- ------------------------------------------------------------------ */
-
-#if defined(VGP_x86_linux)
-# define GET_REAL_SP_AND_FP(sp, fp) \
- asm("movl %%esp, %0;" \
- "movl %%ebp, %1;" \
- : "=3Dr" (sp),\
- "=3Dr" (fp));
-#elif defined(VGP_amd64_linux)
-# define GET_REAL_SP_AND_FP(sp, fp) \
- asm("movq %%rsp, %0;" \
- "movq %%rbp, %1;" \
- : "=3Dr" (sp),\
- "=3Dr" (fp));
-#else
-# error Unknown platform
-#endif
-
-__attribute__ ((noreturn))
-static void report_and_quit ( const Char* report, Addr ip, Addr sp, Addr=
fp )
-{
- #define BACKTRACE_DEPTH 100 // nice and deep!
- Addr stacktop, ips[BACKTRACE_DEPTH];
- ThreadState *tst;
-
- tst =3D VG_(get_ThreadState)( VG_(get_lwp_tid)(VG_(gettid)()) );
-
- // If necessary, fake up an ExeContext which is of our actual real CP=
U
- // state. Could cause problems if we got the panic/exception within =
the
- // execontext/stack dump/symtab code. But it's better than nothing.
- if (0 =3D=3D ip && 0 =3D=3D sp && 0 =3D=3D fp) {
- ip =3D (Addr)__builtin_return_address(0);
- GET_REAL_SP_AND_FP(sp, fp);
- }
-
- stacktop =3D tst->os_state.valgrind_stack_base +=20
- tst->os_state.valgrind_stack_szB;
-
- VG_(get_StackTrace2)(ips, BACKTRACE_DEPTH, ip, sp, fp, sp, stacktop);
- VG_(pp_StackTrace) (ips, BACKTRACE_DEPTH);
-
- VG_(printf)("\nBasic block ctr is approximately %llu\n", VG_(bbs_done=
) );
-
- VG_(pp_sched_status)();
- VG_(printf)("\n");
- VG_(printf)("Note: see also the FAQ.txt in the source distribution.\n=
");
- VG_(printf)("It contains workarounds to several common problems.\n");
- VG_(printf)("\n");
- VG_(printf)("If that doesn't help, please report this bug to: %s\n\n"=
,=20
- report);
- VG_(printf)("In the bug report, send all the above text, the valgrind=
\n");
- VG_(printf)("version, and what Linux distro you are using. Thanks.\n=
\n");
- VG_(exit)(1);
-
- #undef BACKTRACE_DEPTH
-}
-
-void VG_(assert_fail) ( Bool isCore, const Char* expr, const Char* file,=
=20
- Int line, const Char* fn, const HChar* format, .=
.. )
-{
- va_list vargs;
- Char buf[256];
- Char* bufptr =3D buf;
- Char* component;
- Char* bugs_to;
-
- static Bool entered =3D False;
- if (entered)=20
- VG_(exit)(2);
- entered =3D True;
-
- va_start(vargs, format);
- VG_(vsprintf) ( bufptr, format, vargs );
- va_end(vargs);
-
- if (isCore) {
- component =3D "valgrind";
- bugs_to =3D VG_BUGS_TO;
- } else {=20
- component =3D VG_(details).name;
- bugs_to =3D VG_(details).bug_reports_to;
- }
-
- // Treat vg_assert2(0, "foo") specially, as a panicky abort
- if (VG_STREQ(expr, "0")) {
- VG_(printf)("\n%s: %s:%d (%s): the 'impossible' happened.\n",
- component, file, line, fn, expr );
- } else {
- VG_(printf)("\n%s: %s:%d (%s): Assertion '%s' failed.\n",
- component, file, line, fn, expr );
- }
- if (!VG_STREQ(buf, ""))
- VG_(printf)("%s: %s\n", component, buf );
-
- report_and_quit(bugs_to, 0,0,0);
-}
-
-__attribute__ ((noreturn))
-static void panic ( Char* name, Char* report, Char* str,
- Addr ip, Addr sp, Addr fp )
-{
- VG_(printf)("\n%s: the 'impossible' happened:\n %s\n", name, str);
- report_and_quit(report, ip, sp, fp);
-}
-
-void VG_(core_panic_at) ( Char* str, Addr ip, Addr sp, Addr fp )
-{
- panic("valgrind", VG_BUGS_TO, str, ip, sp, fp);
-}
-
-void VG_(core_panic) ( Char* str )
-{
- VG_(core_panic_at)(str, 0,0,0);
-}
-
-void VG_(tool_panic) ( Char* str )
-{
- panic(VG_(details).name, VG_(details).bug_reports_to, str, 0,0,0);
-}
-
-/* Print some helpful-ish text about unimplemented things, and give
- up. */
-void VG_(unimplemented) ( Char* msg )
-{
- VG_(message)(Vg_UserMsg, "");
- VG_(message)(Vg_UserMsg,=20
- "Valgrind detected that your program requires");
- VG_(message)(Vg_UserMsg,=20
- "the following unimplemented functionality:");
- VG_(message)(Vg_UserMsg, " %s", msg);
- VG_(message)(Vg_UserMsg,
- "This may be because the functionality is hard to implement,");
- VG_(message)(Vg_UserMsg,
- "or because no reasonable program would behave this way,");
- VG_(message)(Vg_UserMsg,
- "or because nobody has yet needed it. In any case, let us know at=
");
- VG_(message)(Vg_UserMsg,
- "%s and/or try to work around the problem, if you can.", VG_BUGS_T=
O);
- VG_(message)(Vg_UserMsg,
- "");
- VG_(message)(Vg_UserMsg,
- "Valgrind has to exit now. Sorry. Bye!");
- VG_(message)(Vg_UserMsg,
- "");
- VG_(pp_sched_status)();
- VG_(exit)(1);
-}
-
-
-/* ---------------------------------------------------------------------
Primitive support for reading files.
------------------------------------------------------------------ */
=20
Modified: trunk/coregrind/x86/state.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/x86/state.c 2005-06-03 13:21:18 UTC (rev 3841)
+++ trunk/coregrind/x86/state.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -30,6 +30,7 @@
=20
#include "core.h"
#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
#include "pub_core_tooliface.h"
#include "vki_unistd.h"
#include <sys/ptrace.h>
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-03 13:21:18 UTC (rev 3841)
+++ trunk/helgrind/hg_main.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -33,6 +33,7 @@
#include "pub_tool_debuginfo.h"
#include "pub_tool_hashtable.h"
#include "pub_tool_libcbase.h"
+#include "pub_tool_libcassert.h"
#include "pub_tool_libcprint.h"
#include "pub_tool_mallocfree.h"
#include "pub_tool_options.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-03 13:21:18 UTC (rev 3841)
+++ trunk/include/Makefile.am 2005-06-04 19:16:06 UTC (rev 3842)
@@ -9,6 +9,7 @@
pub_tool_execontext.h \
pub_tool_hashtable.h \
pub_tool_libcbase.h \
+ pub_tool_libcassert.h \
pub_tool_libcprint.h \
pub_tool_mallocfree.h \
pub_tool_options.h \
Added: 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-03 13:21:18 UTC (rev 3841=
)
+++ trunk/include/pub_tool_libcassert.h 2005-06-04 19:16:06 UTC (rev 3842=
)
@@ -0,0 +1,57 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Assertions, etc. pub_tool_libcassert.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_LIBCBASSERT_H
+#define __PUB_TOOL_LIBCBASSERT_H
+
+#define tl_assert(expr) =
\
+ ((void) ((expr) ? 0 : =
\
+ (VG_(assert_fail) (/*isCore?*/False, #expr, =
\
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, =
\
+ ""), =
\
+ 0)))
+
+#define tl_assert2(expr, format, args...) =
\
+ ((void) ((expr) ? 0 : =
\
+ (VG_(assert_fail) (/*isCore?*/False, #expr, =
\
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, =
\
+ format, ##args), =
\
+ 0)))
+
+__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, ... );
+
+#endif // __PUB_TOOL_LIBCBASSERT_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-03 13:21:18 UTC (rev 3841)
+++ trunk/include/tool.h 2005-06-04 19:16:06 UTC (rev 3842)
@@ -172,35 +172,6 @@
extern Bool VG_(getcwd_alloc) ( Char** cwd );
=20
/* ------------------------------------------------------------------ */
-/* assert.h */
-/* Asserts permanently enabled -- no turning off with NDEBUG. Hurrah! *=
/
-
-/* This odd definition lets us stringify VG_(x) function names to
- "vgPlain_x". We need to do two macroexpansions to get the VG_ macro
- expanded before stringifying. */
-#define VG_STRINGIFY_WRK(x) #x
-#define VG_STRINGIFY(x) VG_STRINGIFY_WRK(x)
-
-#define tl_assert(expr) =
\
- ((void) ((expr) ? 0 : =
\
- (VG_(assert_fail) (/*isCore?*/False, VG_STRINGIFY(expr), =
\
- __FILE__, __LINE__, __PRETTY_FUNCTION__, =
\
- ""), =
\
- 0)))
-
-#define tl_assert2(expr, format, args...) =
\
- ((void) ((expr) ? 0 : =
\
- (VG_(assert_fail) (/*isCore?*/False, VG_STRINGIFY(expr), =
\
- __FILE__, __LINE__, __PRETTY_FUNCTION__, =
\
- format, ##args), =
\
- 0)))
-
-__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, ... );
-
-/* ------------------------------------------------------------------ */
/* Get memory by anonymous mmap. */
extern void* VG_(get_memory_from_mmap) ( SizeT nBytes, Char* who );
=20
Modified: trunk/massif/ms_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/massif/ms_main.c 2005-06-03 13:21:18 UTC (rev 3841)
+++ trunk/massif/ms_main.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -38,6 +38,7 @@
#include "pub_tool_debuginfo.h"
#include "pub_tool_hashtable.h"
#include "pub_tool_libcbase.h"
+#include "pub_tool_libcassert.h"
#include "pub_tool_libcprint.h"
#include "pub_tool_mallocfree.h"
#include "pub_tool_options.h"
Modified: trunk/memcheck/mac_leakcheck.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/memcheck/mac_leakcheck.c 2005-06-03 13:21:18 UTC (rev 3841)
+++ trunk/memcheck/mac_leakcheck.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -33,6 +33,7 @@
#include <setjmp.h>
#include "mac_shared.h"
#include "pub_tool_libcbase.h"
+#include "pub_tool_libcassert.h"
#include "pub_tool_libcprint.h"
=20
/* Define to debug the memory-leak-detector. */
Modified: trunk/memcheck/mac_malloc_wrappers.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/memcheck/mac_malloc_wrappers.c 2005-06-03 13:21:18 UTC (rev 384=
1)
+++ trunk/memcheck/mac_malloc_wrappers.c 2005-06-04 19:16:06 UTC (rev 384=
2)
@@ -32,6 +32,7 @@
=20
#include "mac_shared.h"
#include "pub_tool_libcbase.h"
+#include "pub_tool_libcassert.h"
#include "pub_tool_libcprint.h"
=20
/*------------------------------------------------------------*/
Modified: trunk/memcheck/mac_shared.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/memcheck/mac_shared.c 2005-06-03 13:21:18 UTC (rev 3841)
+++ trunk/memcheck/mac_shared.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -31,6 +31,7 @@
*/
=20
#include "mac_shared.h"
+#include "pub_tool_libcassert.h"
#include "pub_tool_libcbase.h"
#include "pub_tool_libcprint.h"
#include "memcheck.h" /* for VG_USERREQ__* */
Modified: trunk/memcheck/mc_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/memcheck/mc_main.c 2005-06-03 13:21:18 UTC (rev 3841)
+++ trunk/memcheck/mc_main.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -39,6 +39,7 @@
#include "mc_include.h"
#include "memcheck.h" /* for client requests */
#include "pub_tool_libcbase.h"
+#include "pub_tool_libcassert.h"
#include "pub_tool_libcprint.h"
=20
=20
Modified: trunk/memcheck/mc_translate.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/memcheck/mc_translate.c 2005-06-03 13:21:18 UTC (rev 3841)
+++ trunk/memcheck/mc_translate.c 2005-06-04 19:16:06 UTC (rev 3842)
@@ -30,6 +30,7 @@
*/
=20
#include "mc_include.h"
+#include "pub_tool_libcassert.h"
#include "pub_tool_libcprint.h"
=20
=20
|
|
From: Nicholas N. <nj...@cs...> - 2005-06-04 04:02:57
|
On Fri, 3 Jun 2005, Jeremy Fitzhardinge wrote: > I generally find embedding assember into .c files is harder to maintain, > mostly because the syntax is so awkward. It's particularly tricky to > use preprocessor macros for constants in embedded asm statements, > because you need to get them into string form so they can be > concatenated with the asm string properly (for naked asms, you can't use > parameter substitution like you can for asms within C functions). I agree with this. Anything bigger than a few lines I prefer to see in a separate .S file. N |
|
From: Eyal L. <ey...@ey...> - 2005-06-04 03:56:12
|
re: https://bugs.kde.org/show_bug.cgi?id=101204 Looks to me like a very straight forward issue. I now have to apply a private patch where the two offending messages are removed from coregrind/m_debuginfo/symtab.c. There is probably a better solution, probably some rate limiting. if (lineno > MAX_LINENO) { #if 0 VG_(message)(Vg_UserMsg, "warning: ignoring line info entry with " "huge line number (%d)", lineno); VG_(message)(Vg_UserMsg, " Can't handle line numbers " "greater than %d, sorry", MAX_LINENO); #endif return; } -- Eyal Lebedinsky (ey...@ey...) <http://samba.org/eyal/> |
|
From: <js...@ac...> - 2005-06-04 02:50:06
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-06-04 03:50:01 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-04 03:50:01 BST |
|
From: Tom H. <to...@co...> - 2005-06-04 02:35:54
|
Nightly build on dunsmere ( athlon, Fedora Core 3 ) started at 2005-06-04 03:30:04 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, 6 stderr failures, 1 stdout failure ================= memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/selfrun (stdout) none/tests/selfrun (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-06-04 02:30:21
|
Nightly build on audi ( i686, Red Hat 9 ) started at 2005-06-04 03:25:02 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 175 tests, 19 stderr failures, 13 stdout failures ================= memcheck/tests/xml1 (stderr) corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/pth_atfork1 (stdout) corecheck/tests/pth_atfork1 (stderr) corecheck/tests/pth_cancel1 (stdout) corecheck/tests/pth_cancel1 (stderr) corecheck/tests/pth_cancel2 (stderr) corecheck/tests/pth_cvsimple (stdout) corecheck/tests/pth_cvsimple (stderr) corecheck/tests/pth_exit (stderr) corecheck/tests/pth_once (stdout) corecheck/tests/pth_once (stderr) corecheck/tests/res_search (stdout) corecheck/tests/res_search (stderr) corecheck/tests/threadederrno (stdout) corecheck/tests/threadederrno (stderr) none/tests/faultstatus (stderr) none/tests/manythreads (stdout) none/tests/manythreads (stderr) none/tests/pth_blockedsig (stdout) none/tests/pth_blockedsig (stderr) none/tests/pth_stackalign (stdout) none/tests/pth_stackalign (stderr) none/tests/thread-exits (stdout) none/tests/thread-exits (stderr) none/tests/threaded-fork (stdout) none/tests/threaded-fork (stderr) none/tests/tls (stdout) none/tests/tls (stderr) none/tests/x86/int (stderr) none/tests/yield (stdout) none/tests/yield (stderr) |
|
From: Tom H. <th...@cy...> - 2005-06-04 02:20:40
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2005-06-04 03:15:02 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 174 tests, 13 stderr failures, 1 stdout failure ================= 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) none/tests/yield (stdout) |
|
From: Tom H. <th...@cy...> - 2005-06-04 02:19:31
|
Nightly build on dellow ( x86_64, Fedora Core 3 ) started at 2005-06-04 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 == 155 tests, 15 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_cmsg (stderr) corecheck/tests/fdleak_dup (stderr) corecheck/tests/fdleak_dup2 (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_pipe (stderr) corecheck/tests/fdleak_socketpair (stderr) massif/tests/toobig-allocs (stderr) none/tests/faultstatus (stderr) none/tests/selfrun (stdout) none/tests/selfrun (stderr) none/tests/yield (stdout) |
|
From: Tom H. <th...@cy...> - 2005-06-04 02:05:35
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2005-06-04 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 == 155 tests, 16 stderr failures, 1 stdout failure ================= 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_cmsg (stderr) corecheck/tests/fdleak_dup (stderr) corecheck/tests/fdleak_dup2 (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_pipe (stderr) corecheck/tests/fdleak_socketpair (stderr) massif/tests/toobig-allocs (stderr) none/tests/faultstatus (stderr) none/tests/selfrun (stdout) none/tests/selfrun (stderr) |