I\'m trying to compile a program with debugging symbols so that valgrind will give me line numbers. I have found that if I compile a simple test program in one go (with -g) then
Just for marking this question as "answered" (so it's not needlessly opened and read by others).
=> Answer is found as the comment from "user1288111" to the initial question.
Final remark - it was indeed an OS X specific 'feature' to do with the way OS X links debug information. Valgrind helps the user circumvent the problem with the command --dsymutil=yes
.
You can read more about it here: http://valgrind.org/docs/manual/manual-core.html#manual-core.erropts
Credit to Dave Goodell who sent me the solution on valgrind users forum.