LLVM  13.0.0git
Functions | Variables
CrashRecoveryContext.cpp File Reference
#include "llvm/Support/CrashRecoveryContext.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ExitCodes.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/ThreadLocal.h"
#include <mutex>
#include <setjmp.h>
#include <signal.h>
Include dependency graph for CrashRecoveryContext.cpp:

Go to the source code of this file.

Functions

static void installExceptionOrSignalHandlers ()
 
static void uninstallExceptionOrSignalHandlers ()
 
static void CrashRecoverySignalHandler (int Signal)
 
static void setThreadBackgroundPriority ()
 
static bool hasThreadBackgroundPriority ()
 
static void RunSafelyOnThread_Dispatch (void *UserData)
 

Variables

static ManagedStatic< std::mutex > gCrashRecoveryContextMutex
 
static bool gCrashRecoveryEnabled = false
 
static ManagedStatic< sys::ThreadLocal< const CrashRecoveryContext > > tlIsRecoveringFromCrash
 
static const int Signals []
 
static const unsigned NumSignals = array_lengthof(Signals)
 
static struct sigaction PrevActions [NumSignals]
 

Function Documentation

◆ CrashRecoverySignalHandler()

static void CrashRecoverySignalHandler ( int  Signal)
static

◆ hasThreadBackgroundPriority()

static bool hasThreadBackgroundPriority ( )
static

◆ installExceptionOrSignalHandlers()

static void installExceptionOrSignalHandlers ( )
static

◆ RunSafelyOnThread_Dispatch()

static void RunSafelyOnThread_Dispatch ( void *  UserData)
static

◆ setThreadBackgroundPriority()

static void setThreadBackgroundPriority ( )
static

Definition at line 467 of file CrashRecoveryContext.cpp.

Referenced by RunSafelyOnThread_Dispatch().

◆ uninstallExceptionOrSignalHandlers()

static void uninstallExceptionOrSignalHandlers ( )
static

Definition at line 403 of file CrashRecoveryContext.cpp.

References i, NumSignals, PrevActions, and Signals.

Referenced by llvm::CrashRecoveryContext::Disable().

Variable Documentation

◆ gCrashRecoveryContextMutex

ManagedStatic<std::mutex> gCrashRecoveryContextMutex
static

◆ gCrashRecoveryEnabled

bool gCrashRecoveryEnabled = false
static

◆ NumSignals

const unsigned NumSignals = array_lengthof(Signals)
static

◆ PrevActions

struct sigaction PrevActions[NumSignals]
static

◆ Signals

const int Signals[]
static
Initial value:
=
{ SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGSEGV, SIGTRAP }

Definition at line 345 of file CrashRecoveryContext.cpp.

Referenced by installExceptionOrSignalHandlers(), and uninstallExceptionOrSignalHandlers().

◆ tlIsRecoveringFromCrash

ManagedStatic<sys::ThreadLocal<const CrashRecoveryContext> > tlIsRecoveringFromCrash
static