Index: src/trusted/service_runtime/osx/mach_exception_handler.c |
diff --git a/src/trusted/service_runtime/osx/mach_exception_handler.c b/src/trusted/service_runtime/osx/mach_exception_handler.c |
index 3cbab30aea467c029509466bb7d90d74162ca2cb..2c0c7d0d46636bf3b43c6dda67c01cadc5af8023 100644 |
--- a/src/trusted/service_runtime/osx/mach_exception_handler.c |
+++ b/src/trusted/service_runtime/osx/mach_exception_handler.c |
@@ -44,7 +44,7 @@ boolean_t nacl_exc_server( |
mach_msg_header_t *OutHeadP); |
-/* Exception types to intercept. */ |
+/* Exception types to intercept. This should be a superset of what Breakpad handles... */ |
#define NACL_MACH_EXCEPTION_MASK \ |
(EXC_MASK_BAD_ACCESS | \ |
EXC_MASK_BAD_INSTRUCTION | \ |
@@ -406,6 +406,16 @@ static kern_return_t ForwardException( |
} |
+static void ReportCrash(int exception_type, int is_untrusted) { |
+ char buf[128]; |
+ int len = snprintf(buf, sizeof(buf), |
+ "\n** Mach exception %d from %s code\n", |
+ exception_type, |
+ is_untrusted ? "untrusted" : "trusted"); |
+ write(2, buf, len); |
+} |
+ |
+ |
kern_return_t nacl_catch_exception_raise( |
mach_port_t exception_port, |
mach_port_t thread, |
@@ -498,6 +508,8 @@ kern_return_t nacl_catch_exception_raise_state_identity ( |
return MACH_RCV_PORT_DIED; |
} |
+ ReportCrash(exception, is_untrusted); |
+ |
/* |
* Don't forward if the crash is untrusted, but unhandled. |
* (As we don't want things like Breakpad handling the crash.) |