Bump date stamp to 20140815
[official-gcc.git] / libsanitizer / sanitizer_common / sanitizer_symbolizer_libbacktrace.h
blobc7a83bfca921a26d088ebf764546caeeb1a93c61
1 //===-- sanitizer_symbolizer_libbacktrace.h ---------------------*- C++ -*-===//
2 //
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
5 //
6 //===----------------------------------------------------------------------===//
7 //
8 // This file is shared between AddressSanitizer and ThreadSanitizer
9 // run-time libraries.
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
21 #endif
23 #ifndef SANITIZER_CP_DEMANGLE
24 # define SANITIZER_CP_DEMANGLE 0
25 #endif
27 namespace __sanitizer {
29 class LibbacktraceSymbolizer {
30 public:
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);
41 private:
42 explicit LibbacktraceSymbolizer(void *state) : state_(state) {}
44 void *state_; // Leaked.
47 } // namespace __sanitizer
48 #endif // SANITIZER_SYMBOLIZER_LIBBACKTRACE_H