Reading LR/FP registers.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Reading LR/FP registers.

via cfe-dev
Hi People,

I am trying to read LR and FP registers address. I have tried calling  the __builtinXXX API's as well as using assembly directly, using Arm cortex M0 and llvm/clang compiler, C language extension. All I get is zeros. Doesn't make scense. Is there a special way to do this?
I found information regarding C++ classes but no C info. Can someone refer me please to the right info?

thanks. 

Eyal. 

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Reading LR/FP registers.

via cfe-dev
Hi Eyal,

On Fri, 12 Oct 2018 at 23:56, Eyal Retter via cfe-dev
<[hidden email]> wrote:
> I am trying to read LR and FP registers address. I have tried calling  the __builtinXXX API's as well as using assembly directly, using Arm cortex M0 and llvm/clang compiler, C language extension. All I get is zeros. Doesn't make scense. Is there a special way to do this?

You should just be able to use __builtin_return_address(0) and
__builtin_frame_address(0). Could you post the code you're using, and
how you're compiling it?

Cheers.

Tim.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev