xref: /llvm-project/compiler-rt/lib/gwp_asan/optional/backtrace_fuchsia.cpp (revision 3341324d82f1278f91b8704048aff414abeaacdb)
198fe39dfSKostya Kortchinsky //===-- backtrace_fuchsia.cpp -----------------------------------*- C++ -*-===//
298fe39dfSKostya Kortchinsky //
398fe39dfSKostya Kortchinsky // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
498fe39dfSKostya Kortchinsky // See https://llvm.org/LICENSE.txt for license information.
598fe39dfSKostya Kortchinsky // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
698fe39dfSKostya Kortchinsky //
798fe39dfSKostya Kortchinsky //===----------------------------------------------------------------------===//
898fe39dfSKostya Kortchinsky 
998fe39dfSKostya Kortchinsky #include "gwp_asan/optional/backtrace.h"
1098fe39dfSKostya Kortchinsky 
11*3341324dSRoland McGrath #include <zircon/sanitizer.h>
1298fe39dfSKostya Kortchinsky 
1398fe39dfSKostya Kortchinsky namespace gwp_asan {
14a8520f69SMitch Phillips namespace backtrace {
1598fe39dfSKostya Kortchinsky 
16*3341324dSRoland McGrath // Fuchsia's C library provides safe, fast, best-effort backtraces itself.
getBacktraceFunction()17*3341324dSRoland McGrath options::Backtrace_t getBacktraceFunction() {
18*3341324dSRoland McGrath   return __sanitizer_fast_backtrace;
19*3341324dSRoland McGrath }
20*3341324dSRoland McGrath 
21*3341324dSRoland McGrath // These are only used in fatal signal handling, which is not used on Fuchsia.
22*3341324dSRoland McGrath 
getPrintBacktraceFunction()23a8520f69SMitch Phillips PrintBacktrace_t getPrintBacktraceFunction() { return nullptr; }
getSegvBacktraceFunction()2498fe39dfSKostya Kortchinsky SegvBacktrace_t getSegvBacktraceFunction() { return nullptr; }
25a8520f69SMitch Phillips 
26a8520f69SMitch Phillips } // namespace backtrace
2798fe39dfSKostya Kortchinsky } // namespace gwp_asan
28