__builtin_return_address()

H . J . Lu hjl@lucon.org
Mon Jul 23 11:17:00 GMT 2001


On Mon, Jul 23, 2001 at 11:13:54AM -0700, Richard Henderson wrote:
> On Mon, Jul 23, 2001 at 10:29:49AM -0700, H . J . Lu wrote:
> > 	* doc/extend.texi: Update __builtin_return_address and
> > 	__builtin_frame_address.
> 
> Ok.
> 
> > +randome value. In addition, @code{__builtin_frame_address} may be used
> 
> "random"
> 

Here is the new patch. I will check it in today.

Thanks.


H.J.
---
2001-07-23  H.J. Lu  (hjl@gnu.org)

	* doc/extend.texi: Update __builtin_return_address and
	__builtin_frame_address.

--- gcc/doc/extend.texi.stack	Tue Jul 17 08:23:30 2001
+++ gcc/doc/extend.texi	Mon Jul 23 10:28:20 2001
@@ -3703,7 +3703,9 @@ The @var{level} argument must be a const
 
 On some machines it may be impossible to determine the return address of
 any function other than the current one; in such cases, or when the top
-of the stack has been reached, this function will return @code{0}.
+of the stack has been reached, this function will return @code{0} or a
+random value. In addition, @code{__builtin_frame_address} may be used
+to determine if the top of the stack has been reached.
 
 This function should only be used with a non-zero argument for debugging
 purposes.
@@ -3725,8 +3727,13 @@ has a dedicated frame pointer register, 
 then @code{__builtin_frame_address} will return the value of the frame
 pointer register.
 
-The caveats that apply to @code{__builtin_return_address} apply to this
-function as well.
+On some machines it may be impossible to determine the frame address of
+any function other than the current one; in such cases, or when the top
+of the stack has been reached, this function will return @code{0} if
+the first frame pointer is properly initialized by the startup code.
+
+This function should only be used with a non-zero argument for debugging
+purposes.
 @end deftypefn
 
 @node Other Builtins



More information about the Gcc-patches mailing list