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
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.