28.2.49 __builtin_return_address

Description

Returns the return address of the current function, or of one of its callers. For the level argument, a value of 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. When level exceeds the current stack depth, 0 will be returned. This function should only be used with a non-zero argument for debugging purposes.

Prototype

int __builtin_return_address (const int level);

Argument

level – Number of frames to scan up the call stack.

Return Value

Returns the return address of the current function, or of one of its callers.

Assembler Operator/ Machine Instruction

return_address