LLVM  8.0.1
Namespaces | Functions | Variables
PrettyStackTrace.cpp File Reference
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm-c/ErrorHandling.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Config/config.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/Watchdog.h"
#include "llvm/Support/raw_ostream.h"
#include <cstdarg>
#include <cstdio>
#include <tuple>
Include dependency graph for PrettyStackTrace.cpp:

Go to the source code of this file.

Namespaces

 llvm
 This class represents lattice values for constants.
 

Functions

PrettyStackTraceEntryllvm::ReverseStackTrace (PrettyStackTraceEntry *Head)
 
static void PrintStack (raw_ostream &OS)
 
static void PrintCurStackTrace (raw_ostream &OS)
 PrintCurStackTrace - Print the current stack trace to the specified stream. More...
 
static void CrashHandler (void *)
 CrashHandler - This callback is run if a fatal signal is delivered to the process, it prints the pretty stack trace. More...
 
static bool RegisterCrashPrinter ()
 
void LLVMEnablePrettyStackTrace ()
 Enable LLVM's built-in stack trace code. More...
 

Variables

static LLVM_THREAD_LOCAL PrettyStackTraceEntryPrettyStackTraceHead = nullptr
 

Function Documentation

◆ CrashHandler()

static void CrashHandler ( void *  )
static

CrashHandler - This callback is run if a fatal signal is delivered to the process, it prints the pretty stack trace.

Definition at line 105 of file PrettyStackTrace.cpp.

References llvm::SmallString< InternalLen >::c_str(), llvm::SmallVectorBase::empty(), llvm::errs(), PrintCurStackTrace(), and llvm::SmallString< InternalLen >::str().

Referenced by RegisterCrashPrinter().

◆ LLVMEnablePrettyStackTrace()

void LLVMEnablePrettyStackTrace ( void  )

Enable LLVM's built-in stack trace code.

This intercepts the OS's crash signals and prints which component of LLVM you were in at the time if the crash.

Definition at line 208 of file PrettyStackTrace.cpp.

References llvm::EnablePrettyStackTrace().

◆ PrintCurStackTrace()

static void PrintCurStackTrace ( raw_ostream OS)
static

PrintCurStackTrace - Print the current stack trace to the specified stream.

Definition at line 72 of file PrettyStackTrace.cpp.

References llvm::raw_ostream::flush(), PrettyStackTraceHead, and PrintStack().

Referenced by CrashHandler().

◆ PrintStack()

static void PrintStack ( raw_ostream OS)
static

◆ RegisterCrashPrinter()

static bool RegisterCrashPrinter ( )
static

Definition at line 179 of file PrettyStackTrace.cpp.

References llvm::sys::AddSignalHandler(), and CrashHandler().

Referenced by llvm::EnablePrettyStackTrace().

Variable Documentation

◆ PrettyStackTraceHead

LLVM_THREAD_LOCAL PrettyStackTraceEntry* PrettyStackTraceHead = nullptr
static