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
tekkotsu-4_0
Revision
1.14
State
Exp
Date
2007/11/13 04:16:03

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
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
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


Define Documentation

#define ST_BODY_UNUSED (  )     (void)UNUSED_##x

portable access to compiler hint not to warn if a function argument is ignored (goes at beginning of function body)

Definition at line 29 of file StackTrace.cc.

Referenced by stacktrace::loadStackTraceSymbols().

#define ST_UNUSED (  )     UNUSED_##x

portable access to compiler hint not to warn if a function argument is ignored (goes in argument list)

Definition at line 27 of file StackTrace.cc.


Tekkotsu v4.0
Generated Thu Nov 22 00:57:28 2007 by Doxygen 1.5.4