aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/compiler-rt/lib/gwp_asan/optional/backtrace_fuchsia.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/compiler-rt/lib/gwp_asan/optional/backtrace_fuchsia.cpp')
-rw-r--r--contrib/llvm-project/compiler-rt/lib/gwp_asan/optional/backtrace_fuchsia.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/llvm-project/compiler-rt/lib/gwp_asan/optional/backtrace_fuchsia.cpp b/contrib/llvm-project/compiler-rt/lib/gwp_asan/optional/backtrace_fuchsia.cpp
new file mode 100644
index 000000000000..09b0325a6fc7
--- /dev/null
+++ b/contrib/llvm-project/compiler-rt/lib/gwp_asan/optional/backtrace_fuchsia.cpp
@@ -0,0 +1,27 @@
+//===-- backtrace_fuchsia.cpp -----------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "gwp_asan/optional/backtrace.h"
+
+#include <zircon/sanitizer.h>
+
+namespace gwp_asan {
+namespace backtrace {
+
+// Fuchsia's C library provides safe, fast, best-effort backtraces itself.
+options::Backtrace_t getBacktraceFunction() {
+ return __sanitizer_fast_backtrace;
+}
+
+// These are only used in fatal signal handling, which is not used on Fuchsia.
+
+PrintBacktrace_t getPrintBacktraceFunction() { return nullptr; }
+SegvBacktrace_t getSegvBacktraceFunction() { return nullptr; }
+
+} // namespace backtrace
+} // namespace gwp_asan