library. These headers are intended to be available to user code when built with AddressSanitizer (or one of the other sanitizer's in the future) to interface with the runtime library. As such, they form stable external C interfaces, and the headers shouldn't be located within the implementation. I've pulled them out into what seem like fairly obvious locations and names, but I'm wide open to further bikeshedding of these names and locations. I've updated the code and the build system to cope with the new locations, both CMake and Makefile. Please let me know if this breaks anyone's build. The eventual goal is to install these headers along side the Clang builtin headers when we build the ASan runtime and install it. My current thinking is to locate them at: <prefix>/lib/clang/X.Y/include/sanitizer/common_interface_defs.h <prefix>/lib/clang/X.Y/include/sanitizer/asan_interface.h <prefix>/lib/clang/X.Y/include/sanitizer/... But maybe others have different suggestions? Fixing the style of the #include between these headers at least unblocks experimentation with installing them as they now should work when installed in these locations. llvm-svn: 162822
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
//===-- asan_stack.cc -----------------------------------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file is a part of AddressSanitizer, an address sanity checker.
|
|
//
|
|
// Code for ASan stack trace.
|
|
//===----------------------------------------------------------------------===//
|
|
#include "asan_flags.h"
|
|
#include "asan_stack.h"
|
|
#include "sanitizer/asan_interface.h"
|
|
|
|
namespace __asan {
|
|
|
|
static __asan_symbolize_callback symbolize_callback;
|
|
|
|
void PrintStack(StackTrace *stack) {
|
|
stack->PrintStack(stack->trace, stack->size, flags()->symbolize,
|
|
flags()->strip_path_prefix, symbolize_callback);
|
|
}
|
|
|
|
|
|
} // namespace __asan
|
|
|
|
// ------------------ Interface -------------- {{{1
|
|
using namespace __asan; // NOLINT
|
|
|
|
void NOINLINE __asan_set_symbolize_callback(
|
|
__asan_symbolize_callback callback) {
|
|
symbolize_callback = callback;
|
|
}
|