|
From: Stephen T. <st...@to...> - 2007-03-31 01:37:36
|
On Sat, 2007-03-31 at 01:05 +0000, Olly Betts wrote: [....] > > What flags should I be using or is there another tool in valgrind I > > should be using instead of memcheck? I do not have a strong skill using > > Valgrind to find errors. So any help would be appreciated. > > If you haven't already, recompile without optimisation (no -O or -O2 > with GCC) but keeping debug info in (keep -g). That helps make > valgrind's reports easy to follow. > > --db-attach=yes is useful too - it lets you attach gdb at the point > in execution where valgrind notices a problem so you can poke around. > > It can also be useful to add calls to VALGRIND_CHECK_MEM_IS_DEFINED > to your program (and add '#include <valgrind/memcheck.h>'): > > http://www.valgrind.org/docs/manual/mc-manual.html#mc-manual.clientreqs So add -DVALGRIND_CHECK_MEM_IS_DEFINED to the compiler flags and then put #include <valgrind/memcheck.h> any where in the program or in all the files? Stephen |