public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* return address in __cyg_profile_func_exit
@ 2009-04-08 14:58 Laurent Burgy
  2009-04-08 15:23 ` Andrew Haley
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Burgy @ 2009-04-08 14:58 UTC (permalink / raw)
  To: gcc-help

Hi,

I've been unable to find a high-level way of getting the original
return address of a function when entering __cyg_profile_func_exit.

__cyg_profile_func_exit is executed at the end of a function, is there
any way (with a builting) to retrieve the original returned value.
That would enable me to investigate the returned values without
modifying the calling site. The information must be somewhere but I
don't know how to reach it. (Getting EBX is not an option that I
consider since the value may depend on the level of optimization -i've
seen it only works with -O0).


Thanks...



--
Laurent Burgy

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: return address in __cyg_profile_func_exit
  2009-04-08 14:58 return address in __cyg_profile_func_exit Laurent Burgy
@ 2009-04-08 15:23 ` Andrew Haley
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Haley @ 2009-04-08 15:23 UTC (permalink / raw)
  To: Laurent Burgy; +Cc: gcc-help

Laurent Burgy wrote:

> I've been unable to find a high-level way of getting the original
> return address of a function when entering __cyg_profile_func_exit.
> 
> __cyg_profile_func_exit is executed at the end of a function, is there
> any way (with a builting) to retrieve the original returned value.
> That would enable me to investigate the returned values without
> modifying the calling site. The information must be somewhere but I
> don't know how to reach it. (Getting EBX is not an option that I
> consider since the value may depend on the level of optimization -i've
> seen it only works with -O0).

The return value is in EAX, but it isn't there when __cyg_profile_func_exit
is called.  It'd be quite easy to modify the compiler to do this, and not
possible otherwise.

Andrew.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-08 15:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-08 14:58 return address in __cyg_profile_func_exit Laurent Burgy
2009-04-08 15:23 ` Andrew Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).