LLVM API Documentation

PrettyStackTrace.cpp File Reference

#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/System/Signals.h"
#include "llvm/System/ThreadLocal.h"
#include "llvm/ADT/SmallString.h"

Include dependency graph for PrettyStackTrace.cpp:

Go to the source code of this file.

Namespaces

namespace  llvm

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.
static void CrashHandler (void *Cookie)
static bool RegisterCrashPrinter ()

Variables

static sys::ThreadLocal< const
PrettyStackTraceEntry > 
PrettyStackTraceHead


Function Documentation

static void CrashHandler ( void *  Cookie  )  [static]

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

Definition at line 60 of file PrettyStackTrace.cpp.

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

Referenced by RegisterCrashPrinter().

static void PrintCurStackTrace ( raw_ostream &  OS  )  [static]

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

Definition at line 40 of file PrettyStackTrace.cpp.

References llvm::raw_ostream::flush(), llvm::sys::ThreadLocal< T >::get(), and PrintStack().

Referenced by CrashHandler().

static unsigned PrintStack ( const PrettyStackTraceEntry *  Entry,
raw_ostream &  OS 
) [static]

static bool RegisterCrashPrinter (  )  [static]


Variable Documentation

Definition at line 27 of file PrettyStackTrace.cpp.