llvm/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp

//===-- sanitizer_symbolizer_report.cpp -----------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//
///
/// This file is shared between AddressSanitizer and other sanitizer run-time
/// libraries and implements symbolized reports related functions.
///
//===----------------------------------------------------------------------===//

#include "sanitizer_common.h"
#include "sanitizer_file.h"
#include "sanitizer_flags.h"
#include "sanitizer_procmaps.h"
#include "sanitizer_report_decorator.h"
#include "sanitizer_stacktrace.h"
#include "sanitizer_stacktrace_printer.h"
#include "sanitizer_symbolizer.h"

#if SANITIZER_POSIX
# include "sanitizer_posix.h"
# include <sys/mman.h>
#endif

namespace __sanitizer {

#if !SANITIZER_GO

static bool FrameIsInternal(const SymbolizedStack *frame) {}

const SymbolizedStack *SkipInternalFrames(const SymbolizedStack *frames) {}

void ReportErrorSummary(const char *error_type, const AddressInfo &info,
                        const char *alt_tool_name) {}
#endif

#if !SANITIZER_FUCHSIA

bool ReportFile::SupportsColors() {}

static inline bool ReportSupportsColors() {}

#else  // SANITIZER_FUCHSIA

// Fuchsia's logs always go through post-processing that handles colorization.
static inline bool ReportSupportsColors() { return true; }

#endif  // !SANITIZER_FUCHSIA

bool ColorizeReports() {}

void ReportErrorSummary(const char *error_type, const StackTrace *stack,
                        const char *alt_tool_name) {}

void ReportMmapWriteExec(int prot, int flags) {}

#if !SANITIZER_FUCHSIA && !SANITIZER_GO
void StartReportDeadlySignal() {}

static void MaybeReportNonExecRegion(uptr pc) {}

static void PrintMemoryByte(InternalScopedString *str, const char *before,
                            u8 byte) {}

static void MaybeDumpInstructionBytes(uptr pc) {}

static void MaybeDumpRegisters(void *context) {}

static void ReportStackOverflowImpl(const SignalContext &sig, u32 tid,
                                    UnwindSignalStackCallbackType unwind,
                                    const void *unwind_context) {}

static void ReportDeadlySignalImpl(const SignalContext &sig, u32 tid,
                                   UnwindSignalStackCallbackType unwind,
                                   const void *unwind_context) {}

void ReportDeadlySignal(const SignalContext &sig, u32 tid,
                        UnwindSignalStackCallbackType unwind,
                        const void *unwind_context) {}

void HandleDeadlySignal(void *siginfo, void *context, u32 tid,
                        UnwindSignalStackCallbackType unwind,
                        const void *unwind_context) {}

#endif  // !SANITIZER_FUCHSIA && !SANITIZER_GO

atomic_uintptr_t ScopedErrorReportLock::reporting_thread_ =;
StaticSpinMutex ScopedErrorReportLock::mutex_;

void ScopedErrorReportLock::Lock() {}

void ScopedErrorReportLock::Unlock() {}

void ScopedErrorReportLock::CheckLocked() {}

}  // namespace __sanitizer