Commit 03ad6298 authored by Arnaud Blanchard's avatar Arnaud Blanchard

Improve debug.sh messaging

parent 499b208c
......@@ -20,35 +20,34 @@ usage(){
echo "usage: debug.sh <project dir> [args ...]"
}
[ $# -lt 1 ] && { echo "Missing project directory."; usage; exit 1; }
[ $1 ] || { echo "Missing project directory."; usage; exit 1; }
#We get the project directory
cd $1
project_dir="$PWD"
project_name=$(basename $project_dir)
cd - > /dev/null
cd `dirname $0`
#We go in blaar directory
cd $(dirname $0)
blaar_dir="$PWD"
blaar_build_dir="${blaar_dir}_build"
cd $1;
project_dir="$PWD";
project_name=`basename $project_dir`;
cd $blaar_dir
./compile.sh "$project_dir" "Debug" "$project_name" > /tmp/blaar/compile_$project_name.log || { echo "Fail compiling '$project_dir'"; cat /tmp/blaar/compile_$project_name.log; exit 2; }
./compile.sh "$project_dir" "Debug" "$project_name" > /tmp/blaar/compile_${project_name}.log || { echo "Fail compiling '$project_dir'"; cat /tmp/blaar/compile_$project_name.log; exit 2; }
bin_dir="$blaar_build_dir/Debug"
shift #remove $0 i.e. debug.sh from $@
command_line="$bin_dir/$project_name $@"
echo
echo "Debug $project_name"
echo
command -v lldb && {
command -v lldb >/dev/null && {
echo "use 'process launch -i <your pipe>' if you want debug with a named pipe"
set -x
lldb -- "$bin_dir/$project_name" "$@"
lldb -- $command_line
}||{
echo "use 'run < <your named pipe>' if you want debug with a named pipe"
set -x
gdb --args "$bin_dir/$project_name" "$@"
gdb --args $command_line
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment