Question about modifying gcc
Joe Buck
Joe.Buck@synopsys.COM
Thu Jun 5 20:05:00 GMT 2008
On Thu, Jun 05, 2008 at 12:55:17PM -0700, dreese@vandals.uidaho.edu wrote:
> I am attempting to modify the compiler to instrument function calls and
> returns. The end result that i am trying to achieve is to send the
> address of every called function to a memory mapped file prior to the
> call and after the call send an immediate value to that same file. The
> target architecture is x86.
You should be able to achieve what you want without modifying the
compiler. Check the manual for the the -finstrument-functions option.
There's also the existing coverage support: compile with -ftest-coverage
-fprofile-arcs, then run gcov.
More information about the Gcc
mailing list