Alfred Perlstein wrote:
>
> On 17 Jul 1999, Dag-Erling Smorgrav wrote:
>
> > Is there any (evidently non-portable) way of determining a function
> > instance's return address? I have an idea or two that involves the
> > return address and dladdr(). The code I currently use looks like this:
>
> This looks like what you are doing is trying to grab the data on the
> stack before "log" which is the return address. I doubt this is
> at all portable and may fail because of optimizations and ABI, such
> as archs that store the return address in a register...
On the SPARC, FWIW, the return address is in %i7. What is difficult to
determine (programmatically) is if the function is a normal or leaf function;
different return sequences are used for each.
--
"Where am I, and what am I doing in this handbasket?"
Wes Peters Softweyr LLC
http://softweyr.com/ [EMAIL PROTECTED]
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message