Path: blob/main/contrib/llvm-project/compiler-rt/lib/gwp_asan/optional/segv_handler.h
35271 views
//===-- segv_handler.h ------------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef GWP_ASAN_OPTIONAL_SEGV_HANDLER_H_9#define GWP_ASAN_OPTIONAL_SEGV_HANDLER_H_1011#include "gwp_asan/guarded_pool_allocator.h"12#include "gwp_asan/optional/backtrace.h"13#include "gwp_asan/optional/printf.h"1415namespace gwp_asan {16namespace segv_handler {17// Install the SIGSEGV crash handler for printing use-after-free and heap-18// buffer-{under|over}flow exceptions if the user asked for it. This is platform19// specific as even though POSIX and Windows both support registering handlers20// through signal(), we have to use platform-specific signal handlers to obtain21// the address that caused the SIGSEGV exception. GPA->init() must be called22// before this function.23void installSignalHandlers(gwp_asan::GuardedPoolAllocator *GPA, Printf_t Printf,24gwp_asan::backtrace::PrintBacktrace_t PrintBacktrace,25gwp_asan::backtrace::SegvBacktrace_t SegvBacktrace,26bool Recoverable = false);2728// Uninistall the signal handlers, test-only.29void uninstallSignalHandlers();30} // namespace segv_handler31} // namespace gwp_asan3233#endif // GWP_ASAN_OPTIONAL_SEGV_HANDLER_H_343536