asan/tsan: rename interceptors from __xsan_xxx to __interceptor_xxx

llvm-svn: 157569
This commit is contained in:
Dmitry Vyukov 2012-05-28 07:47:35 +00:00
parent ebdf670ae7
commit bd310f02a5
4 changed files with 10 additions and 10 deletions

View File

@ -2,10 +2,10 @@
#include <stdio.h>
#include <unistd.h>
extern "C" void *__xsan_malloc(size_t size);
extern "C" void *__interceptor_malloc(size_t size);
extern "C" void *malloc(size_t size) {
write(2, "malloc call\n", sizeof("malloc call\n") - 1);
return __xsan_malloc(size);
return __interceptor_malloc(size);
}
int main() {

View File

@ -1,10 +1,10 @@
#include <stdlib.h>
#include <stdio.h>
extern "C" long __xsan_strtol(const char *nptr, char **endptr, int base);
extern "C" long __interceptor_strtol(const char *nptr, char **endptr, int base);
extern "C" long strtol(const char *nptr, char **endptr, int base) {
fprintf(stderr, "my_strtol_interceptor\n");
return __xsan_strtol(nptr, endptr, base);
return __interceptor_strtol(nptr, endptr, base);
}
int main() {

View File

@ -65,8 +65,8 @@
// with same names in our library and then obtain the real function pointers
// using dlsym().
// There is one complication. A user may also intercept some of the functions
// we intercept. To resolve this we declare our interceptors with __xsan_
// prefix, and then make actual interceptors weak aliases to __xsan_
// we intercept. To resolve this we declare our interceptors with __interceptor_
// prefix, and then make actual interceptors weak aliases to __interceptor_
// functions.
// This is not so on Mac OS, where the two-level namespace makes
// our replacement functions invisible to other libraries. This may be overcomed
@ -93,12 +93,12 @@
# endif
# define DECLARE_WRAPPER(ret_type, convention, func, ...)
#else
# define WRAP(x) __xsan_ ## x
# define WRAPPER_NAME(x) "__xsan_" #x
# define WRAP(x) __interceptor_ ## x
# define WRAPPER_NAME(x) "__interceptor_" #x
# define INTERCEPTOR_ATTRIBUTE __attribute__((visibility("default")))
# define DECLARE_WRAPPER(ret_type, convention, func, ...) \
extern "C" ret_type convention func(__VA_ARGS__) \
__attribute__((weak, alias("__xsan_" #func), visibility("default")))
__attribute__((weak, alias("__interceptor_" #func), visibility("default")))
#endif
#define PTR_TO_REAL(x) real_##x

View File

@ -32,7 +32,7 @@ bool WEAK OnReport(const ReportDesc *rep, bool suppressed) {
static void StackStripMain(ReportStack *stack) {
ReportStack *last_frame = 0;
ReportStack *last_frame2 = 0;
const char *prefix = "__xsan_";
const char *prefix = "__interceptor_";
uptr prefix_len = internal_strlen(prefix);
const char *path_prefix = flags()->strip_path_prefix;
uptr path_prefix_len = internal_strlen(path_prefix);