2012-06-04 21:50:10 +08:00
|
|
|
//===-- asan_stack.cc -----------------------------------------------------===//
|
2011-11-30 09:07:02 +08:00
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//===----------------------------------------------------------------------===//
|
2012-08-28 22:11:57 +08:00
|
|
|
#include "asan_flags.h"
|
2012-08-22 21:31:37 +08:00
|
|
|
#include "asan_interface.h"
|
2011-11-30 09:07:02 +08:00
|
|
|
#include "asan_stack.h"
|
2012-06-04 19:20:17 +08:00
|
|
|
|
2011-11-30 09:07:02 +08:00
|
|
|
namespace __asan {
|
|
|
|
|
2012-08-22 21:31:37 +08:00
|
|
|
static __asan_symbolize_callback symbolize_callback;
|
|
|
|
|
2012-08-28 21:49:49 +08:00
|
|
|
void PrintStack(StackTrace *stack) {
|
|
|
|
stack->PrintStack(stack->trace, stack->size, flags()->symbolize,
|
|
|
|
flags()->strip_path_prefix, symbolize_callback);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-11-30 09:07:02 +08:00
|
|
|
} // namespace __asan
|
2012-08-22 21:31:37 +08:00
|
|
|
|
|
|
|
// ------------------ Interface -------------- {{{1
|
|
|
|
using namespace __asan; // NOLINT
|
|
|
|
|
|
|
|
void NOINLINE __asan_set_symbolize_callback(
|
|
|
|
__asan_symbolize_callback callback) {
|
|
|
|
symbolize_callback = callback;
|
|
|
|
}
|