This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question about modifying gcc
- From: Joe Buck <Joe dot Buck at synopsys dot COM>
- To: dreese at vandals dot uidaho dot edu
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 5 Jun 2008 13:04:46 -0700
- Subject: Re: Question about modifying gcc
- References: <BAY143-W164A38071A1E59459DF85FF3B40@phx.gbl>
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.