This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Editing the AST
- From: Alessandro Pellegrini <alessandro dot pellegrini at tin dot it>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 12 Sep 2008 09:18:42 +0200
- Subject: Editing the AST
Hello!
I'm working on my thesis and I'm analysing two possibilities of
implementation.
What I have to to is to add, before each MOV* instruction, a block of
code to start up a routine that traces memory accesses.
First way of doing so is to edit the ELF generated by gcc to do some
code injection. I would write a software to do that.
I was wandering whether it is possible or not to edit the tree build by
gcc, at compilation time, telling something like "if there is a node
containing a mov, add as a parent the node containing a call to such
routine".
I don't know if I was clear enough =)
I've read something on the Internet, but still I haven't found anything
about this...
Thanks a lot in advance for any help!
--
Alessandro Pellegrini
Email: alessandro.pellegrini@tin.it
Home Page: http://www.roma132.it
Irc Name: Liuk
Totem: Grillo Sapientone
Linux User #438975