]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Darwin only: don't tell aspacemgr about the kernel commpage -- only
authorJulian Seward <jseward@acm.org>
Tue, 8 Jul 2014 07:44:07 +0000 (07:44 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 8 Jul 2014 07:44:07 +0000 (07:44 +0000)
tell the tool.  This is because telling the aspacemgr about it causes
the sync checker to fail entirely on Darwin.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14137

coregrind/m_initimg/initimg-darwin.c
coregrind/m_main.c

index d876ddd6afd21c7394644c46d2ab9b89fd150012..60f74b95ea431dddb40485d0915fabb51e3412ce 100644 (file)
@@ -486,6 +486,15 @@ Addr setup_client_stack( void*  init_sp,
 
 static void record_system_memory(void)
 {
+  /* JRS 2014-Jul-08: this messes up the sync checker, because the
+     information that the kernel gives us doesn't include anything
+     about the commpage mapping.  This functionality has therefore
+     been moved to m_main.c, valgrind_main(), section "Tell the tool
+     about the initial client memory permissions".  See comments there
+     for rationale. */
+   return;
+   /*NOTREACHED*/
+
    /* Tell aspacem where the client's kernel commpage is */
 #if defined(VGA_amd64)
    /* commpage 0x7fff:ffe00000+ - not in vm_region */
index 4485f03585ea2cb3917cb86da113ce2df1e243cb..7641e8cbda4be12db350b5f95c71ab95a1983dec 100644 (file)
@@ -2301,6 +2301,24 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp )
      /* Clear the running thread indicator */
      VG_(running_tid) = VG_INVALID_THREADID;
      tl_assert(VG_(running_tid) == VG_INVALID_THREADID);
+
+     /* Darwin only: tell the tools where the client's kernel commpage
+        is.  It would be better to do this by telling aspacemgr about
+        it -- see the now disused record_system_memory() in
+        initimg-darwin.c -- but that causes the sync checker to fail,
+        since the mapping doesn't appear in the kernel-supplied
+        process map.  So do it here instead. */
+#    if defined(VGP_amd64_darwin)
+     VG_TRACK( new_mem_startup,
+               0x7fffffe00000, 0x7ffffffff000-0x7fffffe00000,
+               True, False, True, /* r-x */
+               0 /* di_handle: no associated debug info */ );
+#    elif defined(VGP_x86_darwin)
+     VG_TRACK( new_mem_startup,
+               0xfffec000, 0xfffff000-0xfffec000,
+               True, False, True, /* r-x */
+               0 /* di_handle: no associated debug info */ );
+#    endif
    }
 
    //--------------------------------------------------------------