llvm/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp

//===-- backtrace_linux_libc.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 <assert.h>
#include <execinfo.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include "gwp_asan/definitions.h"
#include "gwp_asan/optional/backtrace.h"
#include "gwp_asan/optional/printf.h"
#include "gwp_asan/options.h"

namespace {
size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) {}

// We don't need any custom handling for the Segv backtrace - the libc unwinder
// has no problems with unwinding through a signal handler. Force inlining here
// to avoid the additional frame.
GWP_ASAN_ALWAYS_INLINE size_t SegvBacktrace(uintptr_t *TraceBuffer, size_t Size,
                                            void * /*Context*/) {}

static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength,
                           gwp_asan::Printf_t Printf) {}
} // anonymous namespace

namespace gwp_asan {
namespace backtrace {

options::Backtrace_t getBacktraceFunction() {}
PrintBacktrace_t getPrintBacktraceFunction() {}
SegvBacktrace_t getSegvBacktraceFunction() {}

} // namespace backtrace
} // namespace gwp_asan