Is it possible to "create" functions with a gcc plugin?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm using a gcc plugin to do some instrument work during compilation.
Inserting codes in a function is very simple, just like those passes
do in gcc.

But Can I create new functions, and append it to executables? I want
to do the instrument by this way: to create new functions,  add my
codes into them, then instrument some calls to them.

foo:
call to new_function;      //instrument a call

new_function:                 //created function
instrument  codes here

I think the most difficult part is to create functions. Since we can
add arbitrary codes in the functions, it's OK to create "empty
functions" at first.

So is it possible to do so? Any tips?



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux