RETURN_ADDRESS(9) | Kernel Developer's Manual (i386) | RETURN_ADDRESS(9) |
This function is intended to be called by diagnostic code to record the call stack.
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 such as
makeoptions DEBUG="-g -fno-omit-frame-pointer \ -fno-optimize-sibling-calls -O0"
May 5, 2010 | NetBSD 6.1 |