KallistiOS  ##version##
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Functions
stack.h File Reference

Stack traces. More...

#include <sys/cdefs.h>
#include <arch/types.h>

Go to the source code of this file.

Functions

void arch_stk_trace (int n)
 Do a stack trace from the current function. More...
 
void arch_stk_trace_at (uint32 fp, int n)
 Do a stack trace from the current function. More...
 

Detailed Description

Stack traces.

The functions in this file deal with doing stack traces. These functions will do a stack trace, as specified, printing it out to stdout (usually a dcload terminal). These functions only work if frame pointers have been enabled at compile time (-DFRAME_POINTERS and no -fomit-frame-pointer flag).

Author
Dan Potter

Function Documentation

void arch_stk_trace ( int  n)

Do a stack trace from the current function.

This function does a stack trace from the current function, printing the results to stdout. This is used, for instance, when an assertion fails in assert().

Parameters
nThe number of frames to leave off. Each frame is a jump to subroutine or branch to subroutine. assert() leaves off 2 frames, for reference.
void arch_stk_trace_at ( uint32  fp,
int  n 
)

Do a stack trace from the current function.

This function does a stack trace from the the specified frame pointer, printing the results to stdout. This could be used for doing something like stack tracing a main thread from inside an IRQ handler.

Parameters
fpThe frame pointer to start from.
nThe number of frames to leave off.