| www.delorie.com/gnu/docs/gcc/gcc_79.html | search |
![]() Buy the book! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These functions may be used to get information about the callers of a function.
0 yields the return address
of the current function, a value of 1 yields the return address
of the caller of the current function, and so forth.
The level argument must be a constant integer.
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 0 or a
random value. In addition, __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 nonzero argument for debugging purposes.
__builtin_return_address, but it
returns the address of the function frame rather than the return address
of the function. Calling __builtin_frame_address with a value of
0 yields the frame address of the current function, a value of
1 yields the frame address of the caller of the current function,
and so forth.
The frame is the area on the stack which holds local variables and saved
registers. The frame address is normally the address of the first word
pushed on to the stack by the function. However, the exact definition
depends upon the processor and the calling convention. If the processor
has a dedicated frame pointer register, and the function has a frame,
then __builtin_frame_address will return the value of the frame
pointer register.
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 0 if
the first frame pointer is properly initialized by the startup code.
This function should only be used with a nonzero argument for debugging purposes.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |