|
|
|
@ -60,7 +60,7 @@ fi
|
|
|
|
|
case "$1" in
|
|
|
|
|
-g | --gdb)
|
|
|
|
|
shift
|
|
|
|
|
echo "set exec-wrapper env LD_LIBRARY_PATH='$LD_LIBRARY_PATH' LD_PRELOAD='$PRELOAD_LIB' MALLOC_PERTURB_=45" > gdbcmd.tmp
|
|
|
|
|
echo "set exec-wrapper env LD_LIBRARY_PATH='$LD_LIBRARY_PATH' LD_PRELOAD='${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB' MALLOC_PERTURB_=45" > gdbcmd.tmp
|
|
|
|
|
gdb $DF_GDB_OPTS -x gdbcmd.tmp --args ./dwarfort "$@"
|
|
|
|
|
rm gdbcmd.tmp
|
|
|
|
|
ret=$?
|
|
|
|
@ -95,35 +95,35 @@ case "$1" in
|
|
|
|
|
;;
|
|
|
|
|
-h | --helgrind)
|
|
|
|
|
shift
|
|
|
|
|
LD_PRELOAD="$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_HELGRIND_OPTS --tool=helgrind --log-file=helgrind.log ./dwarfort "$@"
|
|
|
|
|
LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_HELGRIND_OPTS --tool=helgrind --log-file=helgrind.log ./dwarfort "$@"
|
|
|
|
|
ret=$?
|
|
|
|
|
;;
|
|
|
|
|
-v | --valgrind)
|
|
|
|
|
shift
|
|
|
|
|
LD_PRELOAD="$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_VALGRIND_OPTS --log-file=valgrind.log ./dwarfort "$@"
|
|
|
|
|
LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_VALGRIND_OPTS --log-file=valgrind.log ./dwarfort "$@"
|
|
|
|
|
ret=$?
|
|
|
|
|
;;
|
|
|
|
|
-c | --callgrind)
|
|
|
|
|
shift
|
|
|
|
|
LD_PRELOAD="$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_CALLGRIND_OPTS --tool=callgrind --separate-threads=yes --dump-instr=yes --instr-atstart=no --log-file=callgrind.log ./dwarfort "$@"
|
|
|
|
|
LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_CALLGRIND_OPTS --tool=callgrind --separate-threads=yes --dump-instr=yes --instr-atstart=no --log-file=callgrind.log ./dwarfort "$@"
|
|
|
|
|
ret=$?
|
|
|
|
|
;;
|
|
|
|
|
--strace)
|
|
|
|
|
shift
|
|
|
|
|
strace -f setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./dwarfort "$@" 2> strace.log
|
|
|
|
|
strace -f setarch "$setarch_arch" -R env LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" ./dwarfort "$@" 2> strace.log
|
|
|
|
|
ret=$?
|
|
|
|
|
;;
|
|
|
|
|
-x | --exec)
|
|
|
|
|
exec setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./dwarfort "$@"
|
|
|
|
|
exec setarch "$setarch_arch" -R env LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" ./dwarfort "$@"
|
|
|
|
|
# script does not resume
|
|
|
|
|
;;
|
|
|
|
|
--sc | --sizecheck)
|
|
|
|
|
PRELOAD_LIB="${PRELOAD_LIB:+$PRELOAD_LIB:}./hack/libsizecheck.so"
|
|
|
|
|
MALLOC_PERTURB_=45 setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./dwarfort "$@"
|
|
|
|
|
MALLOC_PERTURB_=45 setarch "$setarch_arch" -R env LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" ./dwarfort "$@"
|
|
|
|
|
ret=$?
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./dwarfort "$@"
|
|
|
|
|
setarch "$setarch_arch" -R env LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" ./dwarfort "$@"
|
|
|
|
|
ret=$?
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|