2012-08-15 23:24:48 +08:00
|
|
|
//===-- asan_intercepted_functions.h ----------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file is a part of AddressSanitizer, an address sanity checker.
|
|
|
|
//
|
|
|
|
// ASan-private header containing prototypes for wrapper functions and wrappers
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef ASAN_INTERCEPTED_FUNCTIONS_H
|
|
|
|
#define ASAN_INTERCEPTED_FUNCTIONS_H
|
|
|
|
|
2012-12-13 16:50:16 +08:00
|
|
|
#include "sanitizer_common/sanitizer_platform_interceptors.h"
|
2012-08-15 23:24:48 +08:00
|
|
|
|
|
|
|
// Use macro to describe if specific function should be
|
|
|
|
// intercepted on a given platform.
|
2013-03-19 22:33:38 +08:00
|
|
|
#if !SANITIZER_WINDOWS
|
2012-08-15 23:24:48 +08:00
|
|
|
# define ASAN_INTERCEPT_ATOLL_AND_STRTOLL 1
|
|
|
|
# define ASAN_INTERCEPT__LONGJMP 1
|
|
|
|
# define ASAN_INTERCEPT_STRDUP 1
|
|
|
|
# define ASAN_INTERCEPT_INDEX 1
|
|
|
|
# define ASAN_INTERCEPT_PTHREAD_CREATE 1
|
|
|
|
# define ASAN_INTERCEPT_MLOCKX 1
|
|
|
|
#else
|
|
|
|
# define ASAN_INTERCEPT_ATOLL_AND_STRTOLL 0
|
|
|
|
# define ASAN_INTERCEPT__LONGJMP 0
|
|
|
|
# define ASAN_INTERCEPT_STRDUP 0
|
|
|
|
# define ASAN_INTERCEPT_INDEX 0
|
|
|
|
# define ASAN_INTERCEPT_PTHREAD_CREATE 0
|
|
|
|
# define ASAN_INTERCEPT_MLOCKX 0
|
|
|
|
#endif
|
|
|
|
|
2013-03-19 22:33:38 +08:00
|
|
|
#if SANITIZER_LINUX
|
2012-08-15 23:24:48 +08:00
|
|
|
# define ASAN_USE_ALIAS_ATTRIBUTE_FOR_INDEX 1
|
|
|
|
#else
|
|
|
|
# define ASAN_USE_ALIAS_ATTRIBUTE_FOR_INDEX 0
|
|
|
|
#endif
|
|
|
|
|
2013-03-19 22:33:38 +08:00
|
|
|
#if !SANITIZER_MAC
|
2012-08-15 23:24:48 +08:00
|
|
|
# define ASAN_INTERCEPT_STRNLEN 1
|
|
|
|
#else
|
|
|
|
# define ASAN_INTERCEPT_STRNLEN 0
|
|
|
|
#endif
|
|
|
|
|
2013-03-19 22:33:38 +08:00
|
|
|
#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
2012-11-23 18:14:44 +08:00
|
|
|
# define ASAN_INTERCEPT_SWAPCONTEXT 1
|
|
|
|
#else
|
|
|
|
# define ASAN_INTERCEPT_SWAPCONTEXT 0
|
|
|
|
#endif
|
|
|
|
|
2013-03-19 22:33:38 +08:00
|
|
|
#if !SANITIZER_ANDROID && !SANITIZER_WINDOWS
|
2012-08-15 23:24:48 +08:00
|
|
|
# define ASAN_INTERCEPT_SIGNAL_AND_SIGACTION 1
|
|
|
|
#else
|
|
|
|
# define ASAN_INTERCEPT_SIGNAL_AND_SIGACTION 0
|
|
|
|
#endif
|
|
|
|
|
2013-03-19 22:33:38 +08:00
|
|
|
#if !SANITIZER_WINDOWS
|
2012-08-15 23:24:48 +08:00
|
|
|
# define ASAN_INTERCEPT_SIGLONGJMP 1
|
|
|
|
#else
|
|
|
|
# define ASAN_INTERCEPT_SIGLONGJMP 0
|
|
|
|
#endif
|
|
|
|
|
2013-03-19 22:33:38 +08:00
|
|
|
#if ASAN_HAS_EXCEPTIONS && !SANITIZER_WINDOWS
|
2012-08-15 23:24:48 +08:00
|
|
|
# define ASAN_INTERCEPT___CXA_THROW 1
|
|
|
|
#else
|
|
|
|
# define ASAN_INTERCEPT___CXA_THROW 0
|
|
|
|
#endif
|
|
|
|
|
2013-05-24 19:46:56 +08:00
|
|
|
#if !SANITIZER_WINDOWS
|
|
|
|
# define ASAN_INTERCEPT___CXA_ATEXIT 1
|
|
|
|
#else
|
|
|
|
# define ASAN_INTERCEPT___CXA_ATEXIT 0
|
|
|
|
#endif
|
|
|
|
|
2012-08-15 23:24:48 +08:00
|
|
|
#endif // ASAN_INTERCEPTED_FUNCTIONS_H
|