blob: 53a46470a613e02a063c35e26587ddfc9041ad67 [file] [log] [blame]
Alexey Samsonove5f58952012-06-04 13:50:10 +00001//===-- asan_stack.cc -----------------------------------------------------===//
Kostya Serebryany1e172b42011-11-30 01:07:02 +00002//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file is a part of AddressSanitizer, an address sanity checker.
11//
12// Code for ASan stack trace.
13//===----------------------------------------------------------------------===//
Kostya Serebryany1b5ea8f2012-08-28 14:11:57 +000014#include "asan_flags.h"
Kostya Serebryany1e172b42011-11-30 01:07:02 +000015#include "asan_stack.h"
Chandler Carruthd865fec2012-08-29 02:27:54 +000016#include "sanitizer/asan_interface.h"
Alexey Samsonov5f2fe372012-06-04 11:20:17 +000017
Kostya Serebryany1e172b42011-11-30 01:07:02 +000018namespace __asan {
19
Kostya Serebryanycc347222012-08-28 13:49:49 +000020void PrintStack(StackTrace *stack) {
21 stack->PrintStack(stack->trace, stack->size, flags()->symbolize,
Alexey Samsonov1ca53572012-10-02 12:11:17 +000022 flags()->strip_path_prefix, __asan_symbolize);
Kostya Serebryanycc347222012-08-28 13:49:49 +000023}
24
Kostya Serebryany1e172b42011-11-30 01:07:02 +000025} // namespace __asan
Alexey Samsonovc93d3e22012-08-22 13:31:37 +000026
27// ------------------ Interface -------------- {{{1
Alexey Samsonovc93d3e22012-08-22 13:31:37 +000028
Alexey Samsonov1ca53572012-10-02 12:11:17 +000029// Provide default implementation of __asan_symbolize that does nothing
30// and may be overriden by user if he wants to use his own symbolization.
31// ASan on Windows has its own implementation of this.
32#ifndef _WIN32
33SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE NOINLINE
34bool __asan_symbolize(const void *pc, char *out_buffer, int out_size) {
35 return false;
Alexey Samsonovc93d3e22012-08-22 13:31:37 +000036}
Alexey Samsonov1ca53572012-10-02 12:11:17 +000037#endif