summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorPetr Mrázek2011-07-15 15:55:01 +0200
committerPetr Mrázek2011-07-15 15:55:01 +0200
commit459d48d75a017a3b20ac532fdac3181845c282be (patch)
treedb886a1c6580292730af0ba35fbe3ba18fff9551 /package
parent0af631aaa397e36263c7918cc823c737d6acc64f (diff)
downloaddfhack-459d48d75a017a3b20ac532fdac3181845c282be.tar.gz
dfhack-459d48d75a017a3b20ac532fdac3181845c282be.tar.bz2
dfhack-459d48d75a017a3b20ac532fdac3181845c282be.tar.xz
Made the linux console super awesome. The dfhack script won't LD_PRELOAD dfhack for gdb.
Diffstat (limited to 'package')
-rwxr-xr-xpackage/linux/dfhack14
1 files changed, 7 insertions, 7 deletions
diff --git a/package/linux/dfhack b/package/linux/dfhack
index 3b6708f9..d5d22187 100755
--- a/package/linux/dfhack
+++ b/package/linux/dfhack
@@ -10,31 +10,31 @@ cd "${DF_DIR}"
export SDL_DISABLE_LOCK_KEYS=1 # Work around for bug in Debian/Ubuntu SDL patch.
#export SDL_VIDEO_CENTERED=1 # Centre the screen. Messes up resizing.
-export LD_PRELOAD=./libdfhack.so
-
case "$1" in
-g | --gdb)
shift
- gdb ./libs/Dwarf_Fortress $*
+ echo "set environment LD_PRELOAD=./libdfhack.so" > gdbcmd.tmp
+ gdb -x gdbcmd.tmp ./libs/Dwarf_Fortress $*
+ rm gdbcmd.tmp
ret=$?
;;
-h | --helgrind)
shift
- valgrind --tool=helgrind --log-file=helgrind.log ./libs/Dwarf_Fortress $*
+ LD_PRELOAD=./libdfhack.so valgrind --tool=helgrind --log-file=helgrind.log ./libs/Dwarf_Fortress $*
ret=$?
;;
-v | --valgrind)
shift
- valgrind --log-file=valgrind.log ./libs/Dwarf_Fortress $*
+ LD_PRELOAD=./libdfhack.so valgrind --log-file=valgrind.log ./libs/Dwarf_Fortress $*
ret=$?
;;
*)
- ./libs/Dwarf_Fortress $*
+ LD_PRELOAD=./libdfhack.so ./libs/Dwarf_Fortress $*
ret=$?
;;
esac
# Reset terminal to sane state in case of a crash
-reset -I
+reset
exit $ret