|
[Valgrind-developers] Valgrind: r14139 - in
/trunk/coregrind/m_debuginfo: debuginfo.c priv_storage.h
From: <sv...@va...> - 2014-07-08 07:55:52
|
Author: sewardj
Date: Tue Jul 8 07:55:44 2014
New Revision: 14139
Log:
OSX 10.9/10.8: Debuginfo reading FSM: enable recording of r-- mappings
so as to enable arrival at acceptance states via calls to
VG_(di_notify_vm_protect).
Modified:
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/coregrind/m_debuginfo/priv_storage.h
Modified: trunk/coregrind/m_debuginfo/debuginfo.c
==============================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c (original)
+++ trunk/coregrind/m_debuginfo/debuginfo.c Tue Jul 8 07:55:44 2014
@@ -844,7 +844,7 @@
# 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 @@
}
-/* 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 )
{
Modified: trunk/coregrind/m_debuginfo/priv_storage.h
==============================================================================
--- trunk/coregrind/m_debuginfo/priv_storage.h (original)
+++ trunk/coregrind/m_debuginfo/priv_storage.h Tue Jul 8 07:55:44 2014
@@ -506,13 +506,19 @@
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
|