sanitizer_symbolizer_libbacktrace.h revision 296417
1276789Sdim//===-- sanitizer_symbolizer_libbacktrace.h ---------------------*- C++ -*-===// 2276789Sdim// 3276789Sdim// The LLVM Compiler Infrastructure 4276789Sdim// 5276789Sdim// This file is distributed under the University of Illinois Open Source 6276789Sdim// License. See LICENSE.TXT for details. 7276789Sdim// 8276789Sdim//===----------------------------------------------------------------------===// 9276789Sdim// 10276789Sdim// This file is shared between AddressSanitizer and ThreadSanitizer 11276789Sdim// run-time libraries. 12276789Sdim// Header for libbacktrace symbolizer. 13276789Sdim//===----------------------------------------------------------------------===// 14276789Sdim#ifndef SANITIZER_SYMBOLIZER_LIBBACKTRACE_H 15276789Sdim#define SANITIZER_SYMBOLIZER_LIBBACKTRACE_H 16276789Sdim 17276789Sdim#include "sanitizer_platform.h" 18276789Sdim#include "sanitizer_common.h" 19296417Sdim#include "sanitizer_allocator_internal.h" 20288943Sdim#include "sanitizer_symbolizer_internal.h" 21276789Sdim 22276789Sdim#ifndef SANITIZER_LIBBACKTRACE 23276789Sdim# define SANITIZER_LIBBACKTRACE 0 24276789Sdim#endif 25276789Sdim 26276789Sdim#ifndef SANITIZER_CP_DEMANGLE 27276789Sdim# define SANITIZER_CP_DEMANGLE 0 28276789Sdim#endif 29276789Sdim 30276789Sdimnamespace __sanitizer { 31276789Sdim 32288943Sdimclass LibbacktraceSymbolizer : public SymbolizerTool { 33276789Sdim public: 34276789Sdim static LibbacktraceSymbolizer *get(LowLevelAllocator *alloc); 35276789Sdim 36288943Sdim bool SymbolizePC(uptr addr, SymbolizedStack *stack) override; 37276789Sdim 38288943Sdim bool SymbolizeData(uptr addr, DataInfo *info) override; 39276789Sdim 40276789Sdim // May return NULL if demangling failed. 41288943Sdim const char *Demangle(const char *name) override; 42276789Sdim 43276789Sdim private: 44276789Sdim explicit LibbacktraceSymbolizer(void *state) : state_(state) {} 45276789Sdim 46276789Sdim void *state_; // Leaked. 47276789Sdim}; 48276789Sdim 49276789Sdim} // namespace __sanitizer 50276789Sdim#endif // SANITIZER_SYMBOLIZER_LIBBACKTRACE_H 51