Montaż:Jak uruchomić valgrind z podstawowym przykładem c?
bzip2 -d valgrind-3.10.1.tar.bz2
tar -xf valgrind-3.10.1.tar
następnie:
./configure
make
make install
lub prostsza
sudo apt-get install valgrind
Jak uruchomić valgrind tego prostego programu example1.c
#include <stdlib.h>
int main()
{
char *x = malloc(100); /* or, in C++, "char *x = new char[100] */
return 0;
}
Run:
valgrind --tool=memcheck --leak-check=yes example1
valgrind: example1: command not found
Wyjście z konsoli:
valgrind: example1: command not found