Support DF command line arguments with gdb

develop
Pauli 2018-06-12 20:44:21 +03:00
parent bbe70afa2d
commit 69b42d5ecf
1 changed files with 2 additions and 5 deletions

@ -68,11 +68,8 @@ setarch_arch=$(cat hack/dfhack_setarch.txt || printf i386)
case "$1" in case "$1" in
-g | --gdb) -g | --gdb)
shift shift
echo "set environment LD_LIBRARY_PATH $LD_LIBRARY_PATH" > gdbcmd.tmp echo "set exec-wrapper env LD_LIBRARY_PATH='$LD_LIBRARY_PATH' LD_PRELOAD='$PRELOAD_LIB' MALLOC_PERTURB_=45" > gdbcmd.tmp
echo "set environment LD_PRELOAD $PRELOAD_LIB" >> gdbcmd.tmp gdb $DF_GDB_OPTS -x gdbcmd.tmp --args ./libs/Dwarf_Fortress "$@"
echo "set environment MALLOC_PERTURB_ 45" >> gdbcmd.tmp
echo "set startup-with-shell off" >> gdbcmd.tmp
gdb $DF_GDB_OPTS -x gdbcmd.tmp ./libs/Dwarf_Fortress "$@"
rm gdbcmd.tmp rm gdbcmd.tmp
ret=$? ret=$?
;; ;;