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_symbolizer.h"
19 #ifndef SANITIZER_LIBBACKTRACE
20 # define SANITIZER_LIBBACKTRACE 0
23 #ifndef SANITIZER_CP_DEMANGLE
24 # define SANITIZER_CP_DEMANGLE 0
27 namespace __sanitizer
{
29 class LibbacktraceSymbolizer
{
31 static LibbacktraceSymbolizer
*get(LowLevelAllocator
*alloc
);
33 uptr
SymbolizeCode(uptr addr
, AddressInfo
*frames
, uptr max_frames
,
34 const char *module_name
, uptr module_offset
);
36 bool SymbolizeData(DataInfo
*info
);
38 // May return NULL if demangling failed.
39 static char *Demangle(const char *name
, bool always_alloc
= false);
42 explicit LibbacktraceSymbolizer(void *state
) : state_(state
) {}
44 void *state_
; // Leaked.
47 } // namespace __sanitizer
48 #endif // SANITIZER_SYMBOLIZER_LIBBACKTRACE_H