Friday, March 27, 2009

Debugging C,C++ programs on Linux Platform

HI all,

Generally everyone use gdb for debugging C,C++ programs in Linux. There is another tool called valgrind that is an amalgamation of a host of other tools for debugging.For examples memcheck which is used to debug memory related issues, helgrind which is used to debug multithreading programs. The tool is open source and packages exist for all distributions. Usage

valgrind --tool=

Though I must say that you have to read the documentation about the concerned tool to find out exactly what is the meaning of the messages generated by every tool otheriwse its difficult to comprehend the out genereated by the tool for your executable.

Cheers!!!!!!!!!!!!!

1 comment:

Chris said...

There are other symbolic debugger options than GDB. I notice that you have some other posts on threads, so it might interest you to know that there is a debugger written specifically for debugging concurrent (parallel and multithreaded) code. See http://www.totalviewtech.com/support/videos.html#0 for some quick introductory videos. There is a free limited time evaluation available at http://www.totalviewtech.com/download/index.html.

The debugger includes a memory debugger that is significantly faster (for long running codes) than valgrind.

Good luck with your debugging.