3.3.25. Return and frame addresses

This extension enables you to use the following builtin functions:

__builtin_frame_address

Obtains the frame address of a function.

__builtin_return_address

Obtains the return address of a function.

The argument to __builtin_frame_address and __builtin_return_address must be zero.

The following example shows how to use these builtin functions:

int Return_Address_0 ()
{
    static void *aLocal;
    static void *bLocal;
    aLocal = __builtin_return_address (0); // should return the lr
    bLocal = __builtin_frame_address (0);  // should return the sp
    return aLocal + bLocal;
}

Supported in GNU mode only.

Also, see the ARM mode equivalent __return_address().

Copyright © 2002-2006 ARM Limited. All rights reserved.ARM DUI 0205G
Non-Confidential