instrumentation injection & trees

Andrew Pinski pinskia@physics.uc.edu
Thu Mar 3 23:28:00 GMT 2005


On Mar 3, 2005, at 6:12 PM, jason@sourcelabs.com wrote:

> I'm new to the gcc community.  I've been asked to modify gcc to allow 
> it
> to inject various kinds of instrumentation during compilation.  My 
> current
> plan is to capture the tree being generated by the front end, augment 
> it,
> and pass it on to the back end.  It seems like a reasonable approach 
> but I
> can't find much information about interpreting and manipulating trees.
>
> Does anyone have any information about this technique of wedging code
> between the front and back ends, or, better yet, some examples?  Is 
> there
> a better approach?  Are there existing tools that might eliminate the 
> need
> to write this instrumentation injector from scratch?

If you are going this for 4.0.0 and above, you might want to
look into gimplify_function_tree and the code for
flag_instrument_function_entry_exit.


-- Pinski



More information about the Gcc mailing list