wavelength 1.0.0
Loading...
Searching...
No Matches
backtrace.h File Reference

Go to the source code of this file.

Functions

void CaptureStackFrames (unsigned int *pFrames, int nMaxFrames)
 Record the call sites of the functions on the stack, innermost first.
 __attribute__ ((noinline)) unsigned int BacktraceReturnAddress()
 Report the address the caller returns to.

Function Documentation

◆ CaptureStackFrames()

void CaptureStackFrames ( unsigned int * pFrames,
int nMaxFrames )

Record the call sites of the functions on the stack, innermost first.

Each frame's size and the slot of its saved return address come from the epilogue of the function, found by scanning its instructions forward from the return address. A cache of 256 entries keyed by the return address retains each scan. The walk stops at the call of main(), at a frame whose size it cannot find, or when the array is full. A terminating zero follows the recorded sites in the first two cases.

Parameters
pFramesReceives the address of each call instruction.
nMaxFramesThe size of pFrames.
Ghidra address:
NTSC-U/C: 0x0028dc38
Ghidra address:
PAL: 0x00297618

◆ __attribute__()

__attribute__ ( (noinline) )

Report the address the caller returns to.

Report the caller's stack pointer.

Returns
The return address of the caller of this routine.
Ghidra address:
NTSC-U/C: 0x0028de98
Ghidra address:
PAL: 0x00297878
Returns
The stack pointer.
Ghidra address:
NTSC-U/C: 0x0028dea4
Ghidra address:
PAL: 0x00297884