forked from OSchip/llvm-project
[ASan] Get rid of __asan_symbolize function
llvm-svn: 197670
This commit is contained in:
parent
6164aa5969
commit
cef2e14382
|
@ -82,14 +82,6 @@ extern "C" {
|
|||
// the program crashes before ASan report is printed.
|
||||
void __asan_on_error();
|
||||
|
||||
// User may provide its own implementation for symbolization function.
|
||||
// It should print the description of instruction at address "pc" to
|
||||
// "out_buffer". Description should be at most "out_size" bytes long.
|
||||
// User-specified function should return true if symbolization was
|
||||
// successful.
|
||||
bool __asan_symbolize(const void *pc, char *out_buffer,
|
||||
int out_size);
|
||||
|
||||
// Returns the estimated number of bytes that will be reserved by allocator
|
||||
// for request of "size" bytes. If ASan allocator can't allocate that much
|
||||
// memory, returns the maximal possible allocation size, otherwise returns
|
||||
|
|
|
@ -99,10 +99,6 @@ extern "C" {
|
|||
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
|
||||
/* OPTIONAL */ void __asan_on_error();
|
||||
|
||||
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
|
||||
/* OPTIONAL */ bool __asan_symbolize(const void *pc, char *out_buffer,
|
||||
int out_size);
|
||||
|
||||
SANITIZER_INTERFACE_ATTRIBUTE
|
||||
uptr __asan_get_estimated_allocated_size(uptr size);
|
||||
|
||||
|
|
|
@ -18,14 +18,8 @@
|
|||
|
||||
namespace __asan {
|
||||
|
||||
static bool MaybeCallAsanSymbolize(const void *pc, char *out_buffer,
|
||||
int out_size) {
|
||||
return (&__asan_symbolize) ? __asan_symbolize(pc, out_buffer, out_size)
|
||||
: false;
|
||||
}
|
||||
|
||||
void PrintStack(const uptr *trace, uptr size) {
|
||||
StackTrace::PrintStack(trace, size, MaybeCallAsanSymbolize);
|
||||
StackTrace::PrintStack(trace, size);
|
||||
}
|
||||
|
||||
void PrintStack(StackTrace *stack) {
|
||||
|
@ -36,16 +30,6 @@ void PrintStack(StackTrace *stack) {
|
|||
|
||||
// ------------------ Interface -------------- {{{1
|
||||
|
||||
// Provide default implementation of __asan_symbolize that does nothing
|
||||
// and may be overriden by user if he wants to use his own symbolization.
|
||||
// ASan on Windows has its own implementation of this.
|
||||
#if !SANITIZER_SUPPORTS_WEAK_HOOKS
|
||||
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE NOINLINE
|
||||
bool __asan_symbolize(const void *pc, char *out_buffer, int out_size) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
SANITIZER_INTERFACE_ATTRIBUTE
|
||||
void __sanitizer_print_stack_trace() {
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
// RUN: | grep "__asan_" | sed "s/___asan_/__asan_/" \
|
||||
// RUN: | grep -v "__asan_malloc_hook" \
|
||||
// RUN: | grep -v "__asan_free_hook" \
|
||||
// RUN: | grep -v "__asan_symbolize" \
|
||||
// RUN: | grep -v "__asan_default_options" \
|
||||
// RUN: | grep -v "__asan_on_error" > %t.symbols
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
// RUN: | grep "__asan_" | sed "s/___asan_/__asan_/" \
|
||||
// RUN: | grep -v "__asan_malloc_hook" \
|
||||
// RUN: | grep -v "__asan_free_hook" \
|
||||
// RUN: | grep -v "__asan_symbolize" \
|
||||
// RUN: | grep -v "__asan_default_options" \
|
||||
// RUN: | grep -v "__asan_stack_" \
|
||||
// RUN: | grep -v "__asan_on_error" > %t.symbols
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
// RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
extern "C"
|
||||
bool __asan_symbolize(const void *pc, char *out_buffer, int out_size) {
|
||||
snprintf(out_buffer, out_size, "MySymbolizer");
|
||||
return true;
|
||||
}
|
||||
|
||||
int main() {
|
||||
char *x = (char*)malloc(10 * sizeof(char));
|
||||
free(x);
|
||||
return x[5];
|
||||
// CHECK: MySymbolizer
|
||||
}
|
Loading…
Reference in New Issue