valgrind.sh 291 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/bin/sh

./compile.sh $1 "Debug" $1 || exit 1


bin_dir="${PWD}_build/Debug/bin"

program=`basename $1`
shift      #remove $1
echo >&2

command -v valgrind &&{
set -x;
valgrind  --dsymutil=yes $bin_dir/$program "$@" || echo "Problems of memory"
} || echo "You need to install valgrind"