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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
#!/bin/bash
gdb_req="\
This utility requires GDB, the GNU Debugger, to be installed on the system where
Stacks is run. You can check whether this is the case by just typing:
gdb --version
at the command prompt. Note that you may need to load the corresponding module.
GDB is standard scientific software, but may not be installed on some systems.
For further information please contact the administrators of your system;
trying to install GDB without administrator priviledges is not recommended.
For questions please contact us, e.g. at stacks-users@googlegroups.com
"
usage="\
Usage:
$(basename $0) PROGRAM ARGUMENTS
e.g.
$(basename $0) populations -P . -p 3 -r 0.5 --vcf
This utility will run the \`PROGRAM ARGUMENTS\` command as specified, but in
case of a crash it will print additional information, helping us in fixing the
crash.
"
if [[ $# -eq 0 ]] ;then
echo -n "$usage" >&2
echo
echo -n "$gdb_req"
exit 1
fi
if ! command -v gdb &>/dev/null ;then
gdb
echo "Error: GDB is not installed (or loaded)." >&2
echo
echo -n "$gdb_req"
exit 1
fi
exec &> >(tee stacks-gdb.log)
gdb --quiet --args "$@" <<EOF
catch throw
run
backtrace full
EOF
|