how to access PC

Richard Henderson rth at redhat.com
Tue Sep 9 16:28:22 EST 2003


On Mon, Sep 08, 2003 at 06:26:34PM -0700, Andrew Pinski wrote:
> Try this function:
> void * __attribute__((noinline)) getpc()
> {
> 	void *t;
> 	asm("mflr %0":"=r"(t));
> 	return t;
> }

If you're not going to inline, __builtin_return_address(0) will work.


r~

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list