How to debug with valgrind

From KratosWiki
(Difference between revisions)
Jump to: navigation, search
Line 5: Line 5:
 
so this could be a usefull option for complete debug
 
so this could be a usefull option for complete debug
 
  valgrind --leak-check=full python cavity2D-incomstatic.py >debugtest.out
 
  valgrind --leak-check=full python cavity2D-incomstatic.py >debugtest.out
 +
 +
There are some cases in which valgrind gives "Conditional jump or move depends on uninitialised value(s)" message and the error origin is in some statements before. In this cases the  "--track-origins=yes" can be very useful in finding the real source of error.
 +
 +
valgrind --track-origins=yes python cavity2D-incomstatic.py >debugtest.out
 +
 
If instead of the command line, the command is written in "emacs" reading the file is much easier.
 
If instead of the command line, the command is written in "emacs" reading the file is much easier.
  

Revision as of 17:23, 14 November 2011

Using "valgrind"program help one to recognize memory errors. To debug with valgrind in command line while inside example directory execute following line

valgrind python cavity2D-incomstatic.py >debugtest.out

debug process for "cavity2D-incomstatic.py" is saved in "debugtest.out". various options of valgrind are accesable by this command

valgrind --help

so this could be a usefull option for complete debug

valgrind --leak-check=full python cavity2D-incomstatic.py >debugtest.out

There are some cases in which valgrind gives "Conditional jump or move depends on uninitialised value(s)" message and the error origin is in some statements before. In this cases the "--track-origins=yes" can be very useful in finding the real source of error.

valgrind --track-origins=yes python cavity2D-incomstatic.py >debugtest.out

If instead of the command line, the command is written in "emacs" reading the file is much easier.

Personal tools
Categories