28.2.57 __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

int16_t __builtin_return_address (const int16_t 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.