This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Setting Return Address
Laurent Burgy <laurent.burgy@gmail.com> writes:
> I would like to know if it's possible to instrument one function to
> execute another function after each call.
>
> What I would like to do is storing the original return address,
> rewrite it to link to this other "after" function and finally restore
> the original return address to go back to the original execution flow.
>
> I would like something like __cyg_profile_func_exit but without giving
> the -finstrument-functions flag (the problem in this case is that I
> would have to implement a filter in the body of this function or
> annotate all my function with the no_instrument attribute...).
>
>
>
> I've looked in the builtins file but I didn't see anything...
I'm not really clear on where you want to do this. Do you want to use a
compiler option to change the way that your code is compiled? gcc
doesn't have anything like that today (other than
-finstrument-functions).
Ian