return address in __cyg_profile_func_exit

Andrew Haley
Wed Apr 8 15:23:00 GMT 2009

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.


More information about the Gcc-help mailing list