I need to use lightweight instrumentation tools (say, using some existing Python or maybe C pre-processor framework) to systematically insert statements in if-conditions of C functions:
For example, let foo be the C function:
int foo(int x){
if (x>3)
return x;
}
I need to transform it to
int foo(int x){
if (x>3){
print ("%d", x);
return x;
}
}
I have tried using LLVM, but it does not integrate better with other parts of the code. Here, I would prefer a Python/C preprocessor framework solution. Thanks for your ideas.