|
From: <sv...@va...> - 2009-01-16 05:06:41
|
Author: njn
Date: 2009-01-16 05:06:35 +0000 (Fri, 16 Jan 2009)
New Revision: 8961
Log:
Make it compile on Darwin again.
Modified:
branches/DARWIN/coregrind/m_aspacemgr/aspacemgr-linux.c
branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
branches/DARWIN/include/pub_tool_basics.h
Modified: branches/DARWIN/coregrind/m_aspacemgr/aspacemgr-linux.c
===================================================================
--- branches/DARWIN/coregrind/m_aspacemgr/aspacemgr-linux.c 2009-01-15 22:10:35 UTC (rev 8960)
+++ branches/DARWIN/coregrind/m_aspacemgr/aspacemgr-linux.c 2009-01-16 05:06:35 UTC (rev 8961)
@@ -3321,7 +3321,7 @@
static void
parse_procselfmaps (
void (*record_mapping)( Addr addr, SizeT len, UInt prot,
- ULong dev, ULong ino, ULong foff,
+ ULong dev, ULong ino, Off64T foff,
const UChar* filename ),
void (*record_gap)( Addr addr, SizeT len )
)
@@ -3374,7 +3374,7 @@
static const HChar *sync_mapping_where;
static Int sync_mapping_num;
static void add_mapping_callback(Addr addr, SizeT len, UInt prot,
- ULong dev, ULong ino, ULong offset,
+ ULong dev, ULong ino, Off64T offset,
const UChar *filename)
{
// derived from sync_check_mapping_callback()
@@ -3467,7 +3467,9 @@
}
-void sync_mappings(const HChar *when, const HChar *where, Int num)
+// DDD: this is used in other modules -- should have a prototype in a .h
+// file.
+void VG_(sync_mappings)(const HChar *when, const HChar *where, Int num)
{
sync_mapping_when = when ?: "?";
sync_mapping_where = where ?: "?";
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-01-15 22:10:35 UTC (rev 8960)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-01-16 05:06:35 UTC (rev 8961)
@@ -69,8 +69,8 @@
typedef uint64_t mig_addr_t;
-// fixme from aspacemgr-linux.c
-extern void sync_mappings(const HChar *when, const HChar *where, Int num);
+// DDD: fixme from aspacemgr-linux.c
+extern void VG_(sync_mappings)(const HChar *when, const HChar *where, Int num);
// Saved ports
@@ -5495,7 +5495,7 @@
// PRINT("UNHANDLED reply %d", mh->msgh_id);
// Assume the call may have mapped or unmapped memory
- sync_mappings("after", "mach_msg_receive", 0);
+ VG_(sync_mappings)("after", "mach_msg_receive", 0);
}
PRE(mach_msg_receive)
@@ -5808,7 +5808,7 @@
POST(mach_msg_unhandled)
{
- sync_mappings("after", "mach_msg_receive", 0);
+ VG_(sync_mappings)("after", "mach_msg_receive", 0);
}
PRE(mach_msg)
@@ -6202,7 +6202,7 @@
POST(iokit_user_client_trap)
{
- sync_mappings("after", "iokit_user_client_trap", ARG2);
+ VG_(sync_mappings)("after", "iokit_user_client_trap", ARG2);
}
Modified: branches/DARWIN/include/pub_tool_basics.h
===================================================================
--- branches/DARWIN/include/pub_tool_basics.h 2009-01-15 22:10:35 UTC (rev 8960)
+++ branches/DARWIN/include/pub_tool_basics.h 2009-01-16 05:06:35 UTC (rev 8961)
@@ -94,7 +94,16 @@
// - off_t is "used for file sizes".
// At one point we were using it for memory offsets, but PtrdiffT should be
// used in those cases.
+// DDD: on Linux and AIX, off_t is a signed word-sized int. On Darwin it's
+// always a signed 64-bit int. Need to find a way to remove this #if.
+// Killing OffT in favour of Off64T everywhere might work.
+#if defined(VGO_linux) || defined(VGO_aix5)
typedef Word OffT; // 32 64
+#elif defined(VGO_darwin)
+typedef Long OffT; // 32 64
+#else
+# error Unknown OS
+#endif
typedef Long Off64T; // 64 64
#if !defined(NULL)
|