Namespaces |
namespace | stacktrace |
| Holds the C-style interface for the stack trace routines.
|
Defines |
#define | ST_UNUSED(x) UNUSED_##x |
| portable access to compiler hint not to warn if a function argument is ignored (goes in argument list)
|
#define | ST_BODY_UNUSED(x) (void)UNUSED_##x |
| portable access to compiler hint not to warn if a function argument is ignored (goes at beginning of function body)
|
Functions |
int | stacktrace::unrollStackFrame (struct StackFrame *curFrame, struct StackFrame *nextFrame) |
| stores information about the caller to curFrame into nextFrame
|
static int | stacktrace::growAlloc (struct StackFrame *frame) |
static void | stacktrace::allocBacktraceRegion (struct StackFrame *frame, size_t cap) |
static void | stacktrace::freeBacktraceRegion (struct StackFrame *frame) |
void | stacktrace::getCurrentStackFrame (struct StackFrame *frame) |
| stores information about the caller's stack frame into frame
|
void | stacktrace::freeStackTrace (struct StackFrame *frame) |
| frees a list of StackFrames, such as is returned by recordStackTrace
|
struct StackFrame * | stacktrace::allocateStackTrace (unsigned int size) |
| preallocates a stack trace of a particular size (doesn't actually perform a stack trace, merely allocates the linked list)
|
struct StackFrame * | stacktrace::recordStackTrace (unsigned int limit=-1U, unsigned int skip=0) |
| repeatedly calls unrollStackFrame() until the root frame is reached or limit is hit, skipping the top skip frames
|
struct StackFrame * | stacktrace::recordOverStackTrace (struct StackFrame *frame, unsigned int skip=0) |
| repeatedly calls unrollStackFrame() until the root frame is reached or end of frame list is hit, skipping the top skip frames
|
static int | stacktrace::getline (char **s, size_t *len, FILE *f) |
static int | stacktrace::addr2lineLookup (const char *const ex, const void *const off, char **srcfile, size_t *srcfilelen, char **func, size_t *funclen) |
static void | stacktrace::displayRelPath (FILE *os, const char *wd, const char *path) |
static void | stacktrace::beginDisplay () |
| attempts to read symbol information and displays stack trace header
|
static void | stacktrace::displayStackFrame (unsigned int depth, const struct StackFrame *frame) |
static void | stacktrace::completeDisplay (int isend) |
| releases symbol information used during display
|
void | stacktrace::displayCurrentStackTrace (unsigned int limit=-1U, unsigned int skip=0) |
| dumps current stack trace to stderr, up to limit depth and skipping the top skip frames
|
void | stacktrace::displayStackTrace (const struct StackFrame *frame) |
| dumps stored stack trace to stderr
|
Variables |
const size_t | stacktrace::MIN_CAP = 50 |
Implements functionality for performing stack traces.