#include <procfs.h>
#endif // HAVE_PROCFS_H
+#if HAVE_MACH_EXCEPTIONS
+#include "../exception/machexception.h"
+#endif // HAVE_MACH_EXCEPTIONS
+
using namespace CorUnix;
SET_DEFAULT_DEBUG_CHANNEL(DEBUG);
IN PEXCEPTION_RECORD ExceptionRecord
)
{
- native_context_t ucontext;
-
//
//TODO: This needs to be properly implemented
// because this code does not restore XMM registers
//
-
+#if !HAVE_MACH_EXCEPTIONS
#if HAVE_GETCONTEXT
+ native_context_t ucontext;
getcontext(&ucontext);
#else
#error Don't know how to get current context on this platform!
#else
#error Don't know how to set current context on this platform!
#endif
+
+#else
+ MachSetThreadContext(const_cast<CONTEXT *>(ContextRecord));
+ ASSERT("MachSetThreadContext should never return\n");
+#endif // HAVE_MACH_EXCEPTIONS
}
/*++
// The maximum size in bytes of any Mach message we can send or receive. Calculating an exact size for
// this is non trivial (basically because of the security trailers that Mach appends) but the current
// value has proven to be more than enough so far.
- static const size_t kcbMaxMessageSize = 900;
+ static const size_t kcbMaxMessageSize = 1500;
// The following are structures describing the formats of the Mach messages we understand.