Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

StackTrace.cc File Reference


Detailed Description

Implements functionality for performing stack traces.

Author:
ejt (Generalized and implementation for non-MIPS platforms)

Stuart Scandrett (original inspiration, Aperios/MIPS stack operations)

Author
ejt
Name
Revision
1.13
State
Exp
Date
2007/04/09 22:23:41

Definition in file StackTrace.cc.

#include "StackTrace.h"
#include <stdio.h>

Include dependency graph for StackTrace.cc:

Go to the source code of this file.

Namespaces

namespace  stacktrace

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::loadStackTraceSymbols (const char *ST_UNUSED(objfile))
int stacktrace::unrollStackFrame (struct StackFrame *curFrame, struct StackFrame *nextFrame)
 stores information about the caller to curFrame into nextFrame
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
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)
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
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
void stacktrace::beginDisplay ()
 attempts to read symbol information and displays stack trace header
void stacktrace::displayStackFrame (unsigned int ST_UNUSED(depth), const struct StackFrame *frame)
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 char * stacktrace::BFD_DEFAULT_TARGET = "powerpc-apple-darwin8.5.0"
 target string to use when opening symbol files if host architecture can't be detected


Tekkotsu v3.0
Generated Fri May 11 20:06:55 2007 by Doxygen 1.4.7