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

//===-- backtrace_sanitizer_common.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 <stddef.h>
#include <stdint.h>
#include <string.h>

#include "gwp_asan/optional/backtrace.h"
#include "gwp_asan/options.h"
#include "sanitizer_common/sanitizer_common.h"
#include "sanitizer_common/sanitizer_flag_parser.h"
#include "sanitizer_common/sanitizer_flags.h"
#include "sanitizer_common/sanitizer_stacktrace.h"

void __sanitizer::BufferedStackTrace::UnwindImpl(uptr pc, uptr bp,
                                                 void *context,
                                                 bool request_fast,
                                                 u32 max_depth) {}

namespace {
size_t BacktraceCommon(uintptr_t *TraceBuffer, size_t Size, void *Context) {}

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

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 {

// This function is thread-compatible. It must be synchronised in respect to any
// other calls to getBacktraceFunction(), calls to getPrintBacktraceFunction(),
// and calls to either of the functions that they return. Furthermore, this may
// require synchronisation with any calls to sanitizer_common that use flags.
// Generally, this function will be called during the initialisation of the
// allocator, which is done in a thread-compatible manner.
options::Backtrace_t getBacktraceFunction() {}

PrintBacktrace_t getPrintBacktraceFunction() {}
SegvBacktrace_t getSegvBacktraceFunction() {}

} // namespace backtrace
} // namespace gwp_asan