1 //===-- sanitizer_symbolizer_libbacktrace.h ---------------------*- C++ -*-===//
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
6 //===----------------------------------------------------------------------===//
8 // This file is shared between AddressSanitizer and ThreadSanitizer
10 // Header for libbacktrace symbolizer.
11 //===----------------------------------------------------------------------===//
12 #ifndef SANITIZER_SYMBOLIZER_LIBBACKTRACE_H
13 #define SANITIZER_SYMBOLIZER_LIBBACKTRACE_H
15 #include "sanitizer_platform.h"
16 #include "sanitizer_common.h"
17 #include "sanitizer_allocator_internal.h"
18 #include "sanitizer_symbolizer_internal.h"
20 #ifndef SANITIZER_LIBBACKTRACE
21 # define SANITIZER_LIBBACKTRACE 0
24 #ifndef SANITIZER_CP_DEMANGLE
25 # define SANITIZER_CP_DEMANGLE 0
28 namespace __sanitizer
{
30 class LibbacktraceSymbolizer
: public SymbolizerTool
{
32 static LibbacktraceSymbolizer
*get(LowLevelAllocator
*alloc
);
34 bool SymbolizePC(uptr addr
, SymbolizedStack
*stack
) override
;
36 bool SymbolizeData(uptr addr
, DataInfo
*info
) override
;
38 // May return NULL if demangling failed.
39 const char *Demangle(const char *name
) override
;
42 explicit LibbacktraceSymbolizer(void *state
) : state_(state
) {}
44 void *state_
; // Leaked.
47 } // namespace __sanitizer
48 #endif // SANITIZER_SYMBOLIZER_LIBBACKTRACE_H