You can compile with CC=gcc4 CFLAGS=-fmudflap LDFLAGS=-lmudflap to get instrumented binaries. You'll need to install the libmudflap packages to get that to work.
the lighter alternative is the -D_FORTIFY_SOURCE=2 stuff, wihch is less heavy weight runtime overhead wise