This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: __builtin_return_address for ARM


Paul Brook wrote:
> On Wednesday 25 February 2009, Andrew Haley wrote:

> In general it's impossible to make __builtin_return_address(N) to work for
>  N>0.

>> In userland ARM EABI doesn't have a frame pointer chain, so what you 
>> suggest isn't possible.  However, we do need to unwind the stack so we
>> use the unwinder info.  For this you have to call  _Unwind_Backtrace 
>> directly.
>> 
>> As I understand it, the ARM kernel can now do something similar.  So, the
>> only use for a __builtin_return_address(N) that used the frame pointer
>> chain would be if the code were compiled with nonstandard options.
> 
> Correct.

  Well, but wouldn't it still be nice if __builtin_return_address(N) was
implemented for N>0 by libcalling into the unwinder for you?  Obviously this
would still have to return NULL at runtime when you're running on a DW2 target
without any EH frame data present in memory (and I guess it wouldn't work on
SjLj targets either), but wouldn't it still be a nice convenience feature for
users?

    cheers,
      DaveK


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]