This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Setting Return Address
- From: Laurent Burgy <laurent dot burgy at gmail dot com>
- To: gcc-help at gnu dot org
- Date: Wed, 11 Mar 2009 14:45:39 -0400
- Subject: Setting Return Address
Hi....
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...
thanks...