|
From: <sv...@va...> - 2005-09-23 01:25:50
|
Author: sewardj
Date: 2005-09-23 02:25:38 +0100 (Fri, 23 Sep 2005)
New Revision: 4727
Log:
Globalise do_sync_check and call it before and after every syscall
at --sanity-level=3D3.
Modified:
branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
branches/ASPACEM/coregrind/m_scheduler/scheduler.c
branches/ASPACEM/coregrind/pub_core_aspacemgr.h
Modified: branches/ASPACEM/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
--- branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-23 00:54:0=
5 UTC (rev 4726)
+++ branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-23 01:25:3=
8 UTC (rev 4727)
@@ -118,8 +118,8 @@
#define AM_SANITY_CHECK \
do { \
if (VG_(clo_sanity_level >=3D 3)) \
- aspacem_assert(do_sync_check(__PRETTY_FUNCTION__, \
- __FILE__,__LINE__)); \
+ aspacem_assert(VG_(am_do_sync_check) \
+ (__PRETTY_FUNCTION__,__FILE__,__LINE__)); \
} while (0)=20
=20
/* ------ end of STATE for the address-space manager ------ */
@@ -964,7 +964,12 @@
}
=20
=20
- Bool do_sync_check ( HChar* fn, HChar* file, Int line )
+/* Sanity check: check that Valgrind and the kernel agree on the
+ address space layout. Prints offending segments and call point if
+ a discrepancy is detected, but does not abort the system. Returned
+ Bool is False if a discrepancy was found. */
+
+Bool VG_(am_do_sync_check) ( HChar* fn, HChar* file, Int line )
{
sync_check_ok =3D True;
if (0)
Modified: branches/ASPACEM/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
--- branches/ASPACEM/coregrind/m_scheduler/scheduler.c 2005-09-23 00:54:0=
5 UTC (rev 4726)
+++ branches/ASPACEM/coregrind/m_scheduler/scheduler.c 2005-09-23 01:25:3=
8 UTC (rev 4727)
@@ -607,8 +607,15 @@
complete by the time this call returns, and we'll be
runnable again. We could take a signal while the
syscall runs. */
+
+ if (VG_(clo_sanity_level >=3D 3))
+ VG_(am_do_sync_check)("(BEFORE SYSCALL)",__FILE__,__LINE__);
+
SCHEDSETJMP(tid, jumped, VG_(client_syscall)(tid));
=20
+ if (VG_(clo_sanity_level >=3D 3))
+ VG_(am_do_sync_check)("(AFTER SYSCALL)",__FILE__,__LINE__);
+
if (!VG_(is_running_thread)(tid))
VG_(printf)("tid %d not running; VG_(running_tid)=3D%d, tid %d sta=
tus %d\n",
tid, VG_(running_tid), tid, tst->status);
Modified: branches/ASPACEM/coregrind/pub_core_aspacemgr.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
--- branches/ASPACEM/coregrind/pub_core_aspacemgr.h 2005-09-23 00:54:05 U=
TC (rev 4726)
+++ branches/ASPACEM/coregrind/pub_core_aspacemgr.h 2005-09-23 01:25:38 U=
TC (rev 4727)
@@ -116,7 +116,14 @@
/* VG_(am_get_segment_starts) is also part of this section, but its
prototype is tool-visible, hence not in this header file. */
=20
+/* Sanity check: check that Valgrind and the kernel agree on the
+ address space layout. Prints offending segments and call point if
+ a discrepancy is detected, but does not abort the system. Returned
+ Bool is False if a discrepancy was found. */
=20
+extern Bool VG_(am_do_sync_check) ( HChar* fn, HChar* file, Int line );
+
+
//--------------------------------------------------------------
// Functions pertaining to the central query-notify mechanism
// used to handle mmap/munmap/mprotect resulting from client
|