aboutsummaryrefslogtreecommitdiff
path: root/libsanitizer/asan/asan_stack.cc
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2012-11-12 15:53:47 +0000
committerDodji Seketeli <dodji@gcc.gnu.org>2012-11-12 16:53:47 +0100
commitf35db108b96cac4fd3f2b62024ed93ac006ff932 (patch)
tree78af479c74cf29780202765e911b12f4bf192001 /libsanitizer/asan/asan_stack.cc
parent25ae50273ad2801ecc262ba75fa8bac0c4e0001b (diff)
downloadgcc-f35db108b96cac4fd3f2b62024ed93ac006ff932.zip
gcc-f35db108b96cac4fd3f2b62024ed93ac006ff932.tar.gz
gcc-f35db108b96cac4fd3f2b62024ed93ac006ff932.tar.bz2
Import the asan runtime library into GCC tree
This patch imports the runtime library in the GCC tree, ensures that -lasan is passed to the linker when -faddress-sanitizer is used and sets up the build system accordingly. ChangeLog: * configure.ac: Add libsanitizer to target_libraries. * Makefile.def: Ditto. * configure: Regenerate. * Makefile.in: Regenerate. * libsanitizer: New directory for asan runtime. Contains an empty tsan directory. gcc/ChangeLog: * gcc.c (LINK_COMMAND_SPEC): Add -laddress-sanitizer to link command if -faddress-sanitizer is on. libsanitizer: Initial checkin: migrate asan runtime from llvm. From-SVN: r193441
Diffstat (limited to 'libsanitizer/asan/asan_stack.cc')
-rw-r--r--libsanitizer/asan/asan_stack.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/libsanitizer/asan/asan_stack.cc b/libsanitizer/asan/asan_stack.cc
new file mode 100644
index 0000000..2531a7f
--- /dev/null
+++ b/libsanitizer/asan/asan_stack.cc
@@ -0,0 +1,35 @@
+//===-- asan_stack.cc -----------------------------------------------------===//
+//
+// 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 {
+
+void PrintStack(StackTrace *stack) {
+ stack->PrintStack(stack->trace, stack->size, flags()->symbolize,
+ flags()->strip_path_prefix, __asan_symbolize);
+}
+
+} // namespace __asan
+
+// ------------------ Interface -------------- {{{1
+
+// Provide default implementation of __asan_symbolize that does nothing
+// and may be overriden by user if he wants to use his own symbolization.
+// ASan on Windows has its own implementation of this.
+#ifndef _WIN32
+SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE NOINLINE
+bool __asan_symbolize(const void *pc, char *out_buffer, int out_size) {
+ return false;
+}
+#endif