Is it possible to get source coverage (just like it done by gcov) of program, compiled without -pg (FIX, not a -pg really, but fprofile-arcs and ftest-coverage, sorry)? I want to get this without recompiling, e.g. with valgrind, which can instrument programm at runtime. I can afford a very slow execution (up to 1000x slowdown).
What I need is a flag for each source code line: “Was this line executed or not”. I need exact coverage (not a profiling) and for every line (not for functions).
Seems yes: http://benjamin-meyer.blogspot.com/2007/12/valgrind-callgrind-tools-part-3-code.html using a third-party callgrind_tools: