- NetBSD Manual Pages
RETURN_ADDRESS(9) NetBSD/i386 Kernel Developer's Manual RETURN_ADDRESS(9)
Powered by man-cgi (2021-06-01).
Maintained for NetBSD
by Kimmo Suominen.
Based on man-cgi by Panagiotis Christias.
return_address -- return address from call stack
return_address(unsigned int level);
The return_address() function evaluates to the first return address on
the call stack if level equals 0, or else to the return address for the
stack frame level frames down.
This function is intended to be called by diagnostic code to record the
A special fault handler stops return_address() from crashing the kernel
by examining a non-existent or corrupt stack frame.
Kernel compilation options affect both the ability of return_address() to
locate return addresses on the stack, and the programmer's ability to
interpret the addresses. The compiler may optimize away the stack frame
pointers that return_address() depends on.
To use return_address() effecively, try a kernel configuration option
makeoptions DEBUG="-g -fno-omit-frame-pointer \
The return_address() function returns the requested return address, or
NULL if it cannot dissect the call stack.
The return_address() function first appeared in NetBSD 6.0.
David Young <dyoung@NetBSD.org>
NetBSD 9.3 May 5, 2010 NetBSD 9.3