Currently coding on Windows with VS2005 (but wouldn't mind knowing if there are options for other compilers and platforms. I'm most interested in OSX as an alternative platform.) I have a C (no C++) program and I'd like to do the following...
Given a function, say...
int MyFunction(int myparam)
{
// Entry point.
...
// Exit point.
return 1;
}
I'd like to put a snippet of code at the entry point and at the exit point. BUT, I'd rather not have to modify the 100's of functions that are already out there. Is there a way to define function entry and exit code that the compiler will inject for all my functions without having to modify them all?
Most solutions I've found or tried will require me to edit every single function, which is a lot of work. I figure someone else must have hit something like this already and solved it. I can't be unique in this request I suspect.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…