b5f58ba331
(LibbacktraceSymbolizer::Demangle): New declaration. * sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc (POSIXSymbolizer::Demangle): Use libbacktrace_symbolizer_'s Demangle method if possible. * sanitizer_common/sanitizer_symbolizer_libbacktrace.cc: Include "demangle.h" if SANITIZE_CP_DEMANGLE is defined. (struct CplusV3DemangleData): New type. (CplusV3DemangleCallback, CplusV3Demangle): New functions. (SymbolizeCodePCInfoCallback, SymbolizeCodeCallback, SymbolizeDataCallback): Use CplusV3Demangle. * sanitizer_common/Makefile.am (AM_CXXFLAGS): Add -DSANITIZE_CP_DEMANGLE and -I $(top_srcdir)/../include. * libbacktrace/backtrace-rename.h (cplus_demangle_builtin_types, cplus_demangle_fill_ctor, cplus_demangle_fill_dtor, cplus_demangle_fill_extended_operator, cplus_demangle_fill_name, cplus_demangle_init_info, cplus_demangle_mangled_name, cplus_demangle_operators, cplus_demangle_print, cplus_demangle_print_callback, cplus_demangle_type, cplus_demangle_v3, cplus_demangle_v3_callback, is_gnu_v3_mangled_ctor, is_gnu_v3_mangled_dtor, java_demangle_v3, java_demangle_v3_callback): Define. (__asan_internal_memcmp, __asan_internal_strncmp): New prototypes. (memcmp, strncmp): Redefine. * libbacktrace/Makefile.am (libsanitizer_libbacktrace_la_SOURCES): Add ../../libiberty/cp-demangle.c. * libbacktrace/bridge.cc (__asan_internal_memcmp, __asan_internal_strncmp): New functions. * sanitizer_common/Makefile.in: Regenerated. * libbacktrace/Makefile.in: Regenerated. * configure: Regenerated. * configure.ac: Regenerated. * config.h.in: Regenerated. From-SVN: r206477
41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
//===-- sanitizer_symbolizer_libbacktrace.h -------------------------------===//
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file is shared between AddressSanitizer and ThreadSanitizer
|
|
// run-time libraries.
|
|
// Header for libbacktrace symbolizer.
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "sanitizer_platform.h"
|
|
#include "sanitizer_common.h"
|
|
#include "sanitizer_symbolizer.h"
|
|
|
|
#ifndef SANITIZER_LIBBACKTRACE
|
|
# define SANITIZER_LIBBACKTRACE 0
|
|
#endif
|
|
|
|
namespace __sanitizer {
|
|
|
|
class LibbacktraceSymbolizer {
|
|
public:
|
|
static LibbacktraceSymbolizer *get(LowLevelAllocator *alloc);
|
|
|
|
uptr SymbolizeCode(uptr addr, AddressInfo *frames, uptr max_frames,
|
|
const char *module_name, uptr module_offset);
|
|
|
|
bool SymbolizeData(DataInfo *info);
|
|
|
|
const char *Demangle(const char *name);
|
|
|
|
private:
|
|
explicit LibbacktraceSymbolizer(void *state) : state_(state) {}
|
|
|
|
void *state_; // Leaked.
|
|
};
|
|
|
|
} // namespace __sanitizer
|