Ver código fonte

starpupy/examples/execute.sh: add options --valgrind and --gdb to launch application through specified tool

Nathalie Furmento 4 anos atrás
pai
commit
889c1dce78
1 arquivos alterados com 22 adições e 3 exclusões
  1. 22 3
      starpupy/examples/execute.sh.in

+ 22 - 3
starpupy/examples/execute.sh.in

@@ -20,6 +20,19 @@ exampledir=@STARPU_SRC_DIR@/starpupy/examples
 modpath=@STARPU_BUILD_DIR@/src/.libs:
 pypath=@STARPU_BUILD_DIR@/starpupy/src/build:$PYTHONPATH
 
+valgrind=""
+gdb=""
+if test "$1" == "--valgrind"
+then
+    valgrind=1
+    shift
+fi
+if test "$1" == "--gdb"
+then
+    gdb=1
+    shift
+fi
+
 examplefile=$1
 if test -f $examplefile
 then
@@ -34,7 +47,13 @@ fi
 shift
 
 set -x
-#PYTHONPATH=$pypath LD_LIBRARY_PATH=$modpath PYTHONMALLOC=malloc valgrind --track-origins=yes @PYTHON@ $pythonscript $*
-#PYTHONPATH=$pypath LD_LIBRARY_PATH=$modpath gdb --args @PYTHON@ $pythonscript $*
-PYTHONPATH=$pypath LD_LIBRARY_PATH=$modpath @PYTHON@ $pythonscript $*
+if test "$valgrind" == "1"
+then
+    PYTHONPATH=$pypath LD_LIBRARY_PATH=$modpath PYTHONMALLOC=malloc valgrind --track-origins=yes @PYTHON@ $pythonscript $*
+elif test "$gdb" == "1"
+then
+    PYTHONPATH=$pypath LD_LIBRARY_PATH=$modpath gdb --args @PYTHON@ $pythonscript $*
+else
+    PYTHONPATH=$pypath LD_LIBRARY_PATH=$modpath @PYTHON@ $pythonscript $*
+fi