summaryrefslogtreecommitdiff
path: root/lib/asan/asan_mac.cc
diff options
context:
space:
mode:
authorKuba Brecka <kuba.brecka@gmail.com>2015-09-07 12:25:51 +0000
committerKuba Brecka <kuba.brecka@gmail.com>2015-09-07 12:25:51 +0000
commit64b4090290af5c6ab17327c6ee42a001fa6c0d12 (patch)
tree81ed7c68d0ed1b3034cb9c3b89b7eabec7c530a5 /lib/asan/asan_mac.cc
parent1d0eedb05a1ebbfea84205a385541776fceff4b2 (diff)
Revert r246961 "[asan] Intercept and wrap XPC callback blocks".
There is a build failure for the simulator. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@246967 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_mac.cc')
-rw-r--r--lib/asan/asan_mac.cc54
1 files changed, 9 insertions, 45 deletions
diff --git a/lib/asan/asan_mac.cc b/lib/asan/asan_mac.cc
index 3224db8be..0f0f9bb08 100644
--- a/lib/asan/asan_mac.cc
+++ b/lib/asan/asan_mac.cc
@@ -33,18 +33,17 @@ extern "C" {
#endif
#include <dlfcn.h> // for dladdr()
-#include <fcntl.h>
-#include <libkern/OSAtomic.h>
#include <mach-o/dyld.h>
#include <mach-o/loader.h>
-#include <pthread.h>
-#include <stdlib.h> // for free()
#include <sys/mman.h>
#include <sys/resource.h>
#include <sys/sysctl.h>
#include <sys/ucontext.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <stdlib.h> // for free()
#include <unistd.h>
-#include <xpc/xpc.h>
+#include <libkern/OSAtomic.h>
namespace __asan {
@@ -273,6 +272,11 @@ void ReadContextStack(void *context, uptr *stack, uptr *ssize) {
// The implementation details are at
// http://libdispatch.macosforge.org/trac/browser/trunk/src/queue.c
+typedef void* dispatch_group_t;
+typedef void* dispatch_queue_t;
+typedef void* dispatch_source_t;
+typedef u64 dispatch_time_t;
+typedef void (*dispatch_function_t)(void *block);
typedef void* (*worker_t)(void *block);
// A wrapper for the ObjC blocks used to support libdispatch.
@@ -395,15 +399,6 @@ void dispatch_source_set_event_handler(dispatch_source_t ds, void(^work)(void));
work(); \
}
-#define GET_ASAN_BLOCK_XPC(work) \
- void (^asan_block)(xpc_object_t object); \
- int parent_tid = GetCurrentTidOrInvalid(); \
- asan_block = ^(xpc_object_t object) { \
- GET_STACK_TRACE_THREAD; \
- asan_register_worker_thread(parent_tid, &stack); \
- work(object); \
- }
-
INTERCEPTOR(void, dispatch_async,
dispatch_queue_t dq, void(^work)(void)) {
ENABLE_FRAME_POINTER;
@@ -442,37 +437,6 @@ INTERCEPTOR(void, dispatch_source_set_event_handler,
GET_ASAN_BLOCK(work);
REAL(dispatch_source_set_event_handler)(ds, asan_block);
}
-
-INTERCEPTOR(void, xpc_connection_send_message_with_reply,
- xpc_connection_t connection, xpc_object_t message,
- dispatch_queue_t replyq, xpc_handler_t handler) {
- ENABLE_FRAME_POINTER;
- GET_ASAN_BLOCK_XPC(handler);
- REAL(xpc_connection_send_message_with_reply)(connection, message, replyq,
- asan_block);
-}
-
-INTERCEPTOR(void, xpc_connection_set_event_handler, xpc_connection_t connection,
- xpc_handler_t handler) {
- ENABLE_FRAME_POINTER;
- GET_ASAN_BLOCK_XPC(handler);
- REAL(xpc_connection_set_event_handler)(connection, asan_block);
-}
-
-INTERCEPTOR(void, xpc_set_event_stream_handler, const char *stream,
- dispatch_queue_t targetq, xpc_handler_t handler) {
- ENABLE_FRAME_POINTER;
- GET_ASAN_BLOCK_XPC(handler);
- REAL(xpc_set_event_stream_handler)(stream, targetq, asan_block);
-}
-
-INTERCEPTOR(void, xpc_connection_send_barrier, xpc_connection_t connection,
- dispatch_block_t barrier) {
- ENABLE_FRAME_POINTER;
- GET_ASAN_BLOCK(barrier);
- REAL(xpc_connection_send_barrier)(connection, asan_block);
-}
-
#endif
#endif // SANITIZER_MAC