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 pl
It's Microsoft-specific, but you can hook into the _penter and _pexit functions to do something when entering and exiting a function -- you'll have to compile your project with some special flags.
There's a little bit of a tutorial here, and you can find a few more results on how to use them on Google. Also, this blog post goes into some detail on the assembly that you need to do to avoid messing up the stack on entry and exit.