debug.sh 381 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#!/bin/sh

blar_build_dir="${PWD}/build"

./compile.sh $1 "Debug" $1 || {
	echo "fail compiling '$1'"
	exit 1
}

bin_dir="$blar_build_dir/Debug/bin"

program=`basename $1`
shift      #remove $1
echo >&2
echo "'run' to start" >&2
echo >&2
echo "execute:" >&2


command -v lldb && {
   set -x; lldb -- "$bin_dir/$program"  "$@"
}||{
   set -x; gdb --args $bin_dir/$program "$@"
}