[cfe-dev] Reading LR/FP registers.

Tim Northover via cfe-dev cfe-dev at lists.llvm.org
Mon Oct 15 11:20:06 PDT 2018


Hi Eyal,

On Fri, 12 Oct 2018 at 23:56, Eyal Retter via cfe-dev
<cfe-dev at lists.llvm.org> 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.



More information about the cfe-dev mailing list