I am trying to install valgrind on my CentOS-5.5-32bit, to check for memory issue in my source. As i am very unfamiliar with Linux, I couldn't do it myself and couldn't find any such commands by searching also.
I downloaded an extracted valgrind 3.9.0 using these commands. But don't know how to install and run my source under valgrind.
wget http://valgrind.org/downloads/valgrind-3.9.0.tar.bz2
tar xvjf valgrind-3.9.0.tar.bz2
Thanks in advance for the help!
After Several attempts, i finally got it working. The steps i followed:
wget http://valgrind.org/downloads/valgrind-3.9.0.tar.bz2 //download valgrind
tar xvjf valgrind-3.9.0.tar.bz2 //now extract
cd valgrind-3.9.0 //move to the corresponding dir
./configure //prepare everything
make
make install //now install
Now I can Execute my target executable under valgrind!
To execute under valgrind use:
valgrind --tool=memcheck --leak-check=yes COMMAND_TO_RUN_MY_TARGET_EXECUTABLE
To Add origin information use:
--track-origins=yes
To save all the reports in a log file use:
--log-file="Valgrind_Report.txt"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With