]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
OSX 10.9/10.8: Debuginfo reading FSM: enable recording of r-- mappings
authorJulian Seward <jseward@acm.org>
Tue, 8 Jul 2014 07:55:44 +0000 (07:55 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 8 Jul 2014 07:55:44 +0000 (07:55 +0000)
so as to enable arrival at acceptance states via calls to
VG_(di_notify_vm_protect).

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

coregrind/m_debuginfo/debuginfo.c
coregrind/m_debuginfo/priv_storage.h

index 6b3e8229373b0ebdfcc078e3efebd29151d94d11..13d27f0c3c47084d5b6f01000f9006840c906cce 100644 (file)
@@ -844,7 +844,7 @@ ULong VG_(di_notify_mmap)( Addr a, Bool allow_SkFileV, Int use_fd )
 #    error "Unknown platform"
 #  endif
 
-#  if defined(VGP_x86_darwin) && DARWIN_VERS == DARWIN_10_7
+#  if defined(VGP_x86_darwin) && DARWIN_VERS >= DARWIN_10_7
    is_ro_map = seg->hasR && !seg->hasW && !seg->hasX;
 #  endif
 
@@ -981,7 +981,7 @@ void VG_(di_notify_mprotect)( Addr a, SizeT len, UInt prot )
 }
 
 
-/* This is a MacOSX 10.7 32-bit only special.  See comments on the
+/* This is a MacOSX >= 10.7 32-bit only special.  See comments on the
    declaration of struct _DebugInfoFSM for details. */
 void VG_(di_notify_vm_protect)( Addr a, SizeT len, UInt prot )
 {
index 5740442876eaa96ed766a9b4351599398a9ae8cc..000d5f15a5f894c251d9d76162b5b106445e3be2 100644 (file)
@@ -506,13 +506,19 @@ ML_(cmp_for_DiAddrRange_range) ( const void* keyV, const void* elemV );
 
    that is, take the first r-x and rw- mapping we see, and we're done.
 
-   On MacOSX 10.7, 32-bit, there appears to be a new variant:
+   On MacOSX >= 10.7, 32-bit, there appears to be a new variant:
 
    start  -->  r-- mapping  -->  rw- mapping  
           -->  upgrade r-- mapping to r-x mapping  -->  accept
 
-   where the upgrade is done by a call to vm_protect.  Hence we
-   need to also track this possibility.
+   where the upgrade is done by a call to mach_vm_protect (OSX 10.7)
+   or kernelrpc_mach_vm_protect_trap (OSX 10.9 and possibly 10.8).
+   Hence we need to also track this possibility.
+
+   From perusal of dyld sources, it appears that this scheme could
+   also be used 64 bit libraries, although that doesn't seem to happen
+   in practice.  dyld uses this scheme when the text section requires
+   relocation, which only appears to be the case for 32 bit objects.
 */
 
 struct _DebugInfoMapping