This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Code Instrumentation


Hallo,

i would like to instrument some existing code. For example, after an ADD-EXPR:

int main() {
  int a=5;
  int b=5;
  int c = a + b; ...
}

should become:
...
 int c = a + b;
 puts("ADD-EXPR");
...

I thought writing a Gimple-pass would be best, but i don't know exactly where to start. I'm able to walk throug the Gimple-Statements and debug it, but i'm not able to insert something.
Is there any source-code available?

Thanks
Wolfgang
-- 
GRATIS fÃr alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]