1 //===-- asan_stack.cc -----------------------------------------------------===//
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
6 //===----------------------------------------------------------------------===//
8 // This file is a part of AddressSanitizer, an address sanity checker.
10 // Code for ASan stack trace.
11 //===----------------------------------------------------------------------===//
12 #include "asan_internal.h"
13 #include "asan_flags.h"
14 #include "asan_stack.h"
18 static bool MaybeCallAsanSymbolize(const void *pc
, char *out_buffer
,
20 return (&__asan_symbolize
) ? __asan_symbolize(pc
, out_buffer
, out_size
)
24 void PrintStack(StackTrace
*stack
) {
25 stack
->PrintStack(stack
->trace
, stack
->size
, flags()->symbolize
,
26 flags()->strip_path_prefix
, MaybeCallAsanSymbolize
);
31 // ------------------ Interface -------------- {{{1
33 // Provide default implementation of __asan_symbolize that does nothing
34 // and may be overriden by user if he wants to use his own symbolization.
35 // ASan on Windows has its own implementation of this.
36 #if !defined(_WIN32) && !SANITIZER_SUPPORTS_WEAK_HOOKS
37 SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE NOINLINE
38 bool __asan_symbolize(const void *pc
, char *out_buffer
, int out_size
) {