Module Name: src Committed By: jruoho Date: Wed May 5 05:43:19 UTC 2010
Modified Files: src/share/man/man9/man9.i386: return_address.9 Log Message: .Nm -> .Fn, and wrap the kernel config option so that it will fit into 80 columns. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/share/man/man9/man9.i386/return_address.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/share/man/man9/man9.i386/return_address.9 diff -u src/share/man/man9/man9.i386/return_address.9:1.2 src/share/man/man9/man9.i386/return_address.9:1.3 --- src/share/man/man9/man9.i386/return_address.9:1.2 Tue Nov 3 11:04:32 2009 +++ src/share/man/man9/man9.i386/return_address.9 Wed May 5 05:43:19 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: return_address.9,v 1.2 2009/11/03 11:04:32 wiz Exp $ +.\" $NetBSD: return_address.9,v 1.3 2010/05/05 05:43:19 jruoho Exp $ .\" .\" Copyright (c) 2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 2, 2009 +.Dd May 5, 2010 .Dt RETURN_ADDRESS 9 i386 .Os .Sh NAME @@ -39,7 +39,7 @@ .Fn return_address "unsigned int level" .Sh DESCRIPTION The -.Nm +.Fn return_address function evaluates to the first return address on the call stack if .Fa level @@ -52,27 +52,29 @@ the call stack. .Pp A special fault handler stops -.Nm +.Fn return_address from crashing the kernel by examining a non-existent or corrupt stack frame. .Pp Kernel compilation options affect both the ability of -.Nm +.Fn 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 -.Nm +.Fn return_address depends on. +.Pp To use -.Nm +.Fn return_address effecively, try a kernel configuration option such as .Bd -literal -makeoptions DEBUG="-g -fno-omit-frame-pointer -fno-optimize-sibling-calls -O0" +makeoptions DEBUG="-g -fno-omit-frame-pointer \\ + -fno-optimize-sibling-calls -O0" .Ed .Sh RETURN VALUES -.Nm -returns the -requested return address, or +The +.Fn return_address +returns the requested return address, or .Dv NULL if it cannot dissect the call stack. .Sh CODE REFERENCES @@ -81,7 +83,8 @@ .Sh REFERENCES .Xr config 5 .Sh HISTORY -.Nm +The +.Fn return_address first appeared in .Nx 6.0 . .Sh AUTHORS