The offset of a local variable relative to the frame address in C or C++ may be found by||:
||
|(char*)&a -(char*)__builtin_frame_address(0)|
||
|||A more straightforward builtin should be already available by gcc. Which is it ?|
||
|p.s. the previous code adds the offset to bp and afterwards subtracts from the result bp.|

||
||||
||
||

Reply via email to