[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Finding address of where a function called from
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] Finding address of where a function called from |
Date: |
Thu, 29 Jan 2004 10:07:17 +0100 (MET) |
Tom Harris <address@hidden> wrote:
> For logging purposes I would like the called function to be able to
> find out where it was called _from_. What I have done in the past is
> to take the address of a dummy variable on the stack, add a bit to
> it and hope that the result is the address of the stack with the
> return in it.
Better use inline asm, and add an offset to the frame pointer. Look
at the generated assembler code (avr-gcc -S) to see how the stack
frames are handled.
--
J"org Wunsch Unix support engineer
address@hidden http://www.interface-systems.de/~j/