|
|
@ -36,6 +36,8 @@ fi
|
|
|
|
old_tty_settings=$(stty -g)
|
|
|
|
old_tty_settings=$(stty -g)
|
|
|
|
|
|
|
|
|
|
|
|
# Now run
|
|
|
|
# Now run
|
|
|
|
|
|
|
|
export LD_LIBRARY_PATH="./hack:$LD_LIBRARY_PATH"
|
|
|
|
|
|
|
|
|
|
|
|
LIB="./hack/libdfhack.so"
|
|
|
|
LIB="./hack/libdfhack.so"
|
|
|
|
LIBSAN=""
|
|
|
|
LIBSAN=""
|
|
|
|
if which objdump > /dev/null; then
|
|
|
|
if which objdump > /dev/null; then
|
|
|
@ -58,7 +60,7 @@ fi
|
|
|
|
case "$1" in
|
|
|
|
case "$1" in
|
|
|
|
-g | --gdb)
|
|
|
|
-g | --gdb)
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
echo "set exec-wrapper env LD_PRELOAD='$PRELOAD_LIB' MALLOC_PERTURB_=45" > gdbcmd.tmp
|
|
|
|
echo "set exec-wrapper env LD_LIBRARY_PATH='$LD_LIBRARY_PATH' LD_PRELOAD='$PRELOAD_LIB' MALLOC_PERTURB_=45" > gdbcmd.tmp
|
|
|
|
gdb $DF_GDB_OPTS -x gdbcmd.tmp --args ./dwarfort "$@"
|
|
|
|
gdb $DF_GDB_OPTS -x gdbcmd.tmp --args ./dwarfort "$@"
|
|
|
|
rm gdbcmd.tmp
|
|
|
|
rm gdbcmd.tmp
|
|
|
|
ret=$?
|
|
|
|
ret=$?
|
|
|
@ -71,7 +73,8 @@ case "$1" in
|
|
|
|
echo "If your world gen name has spaces you need to remove spaces from the name in data/init/world_gen.txt"
|
|
|
|
echo "If your world gen name has spaces you need to remove spaces from the name in data/init/world_gen.txt"
|
|
|
|
echo "****"
|
|
|
|
echo "****"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
echo "set environment LD_PRELOAD $PRELOAD_LIB" > gdbcmd.tmp
|
|
|
|
echo "set environment LD_LIBRARY_PATH $LD_LIBRARY_PATH" > gdbcmd.tmp
|
|
|
|
|
|
|
|
echo "set environment LD_PRELOAD $PRELOAD_LIB" >> gdbcmd.tmp
|
|
|
|
echo "set environment MALLOC_PERTURB_ 45" >> gdbcmd.tmp
|
|
|
|
echo "set environment MALLOC_PERTURB_ 45" >> gdbcmd.tmp
|
|
|
|
echo "set startup-with-shell off" >> gdbcmd.tmp
|
|
|
|
echo "set startup-with-shell off" >> gdbcmd.tmp
|
|
|
|
echo "target extended-remote localhost:12345" >> gdbcmd.tmp
|
|
|
|
echo "target extended-remote localhost:12345" >> gdbcmd.tmp
|
|
|
|