LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions | Variables
PrettyStackTrace.cpp File Reference
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Config/config.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/ThreadLocal.h"
#include "llvm/Support/Watchdog.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm-c/Core.h"
Include dependency graph for PrettyStackTrace.cpp:

Go to the source code of this file.

Functions

static unsigned PrintStack (const PrettyStackTraceEntry *Entry, raw_ostream &OS)
 
static void PrintCurStackTrace (raw_ostream &OS)
 PrintCurStackTrace - Print the current stack trace to the specified stream. More...
 
static void CrashHandler (void *)
 
static bool RegisterCrashPrinter ()
 
void LLVMEnablePrettyStackTrace ()
 

Variables

static ManagedStatic
< sys::ThreadLocal< const
PrettyStackTraceEntry > > 
PrettyStackTraceHead
 

Function Documentation

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 76 of file PrettyStackTrace.cpp.

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

Referenced by RegisterCrashPrinter().

static void PrintCurStackTrace ( raw_ostream OS)
static

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

Definition at line 47 of file PrettyStackTrace.cpp.

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

Referenced by CrashHandler().

static unsigned PrintStack ( const PrettyStackTraceEntry Entry,
raw_ostream OS 
)
static
static bool RegisterCrashPrinter ( )
static

Definition at line 138 of file PrettyStackTrace.cpp.

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

Referenced by llvm::EnablePrettyStackTrace().

Variable Documentation

ManagedStatic<sys::ThreadLocal<const PrettyStackTraceEntry> > PrettyStackTraceHead
static