summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorPetr Mrázek2011-07-14 04:06:12 +0200
committerPetr Mrázek2011-07-14 04:06:12 +0200
commit96153a7b05e7ecfaa0f2c4ab744ae3c71144ff41 (patch)
tree6e1e8c1c7096009fa6532bda4498f3bdb7751c6a /package
parent792d272fbf3a1a80d597757300b9a33ea083bcc2 (diff)
parent1830183406720181c6465714843ed34d4152b6ed (diff)
downloaddfhack-96153a7b05e7ecfaa0f2c4ab744ae3c71144ff41.tar.gz
dfhack-96153a7b05e7ecfaa0f2c4ab744ae3c71144ff41.tar.bz2
dfhack-96153a7b05e7ecfaa0f2c4ab744ae3c71144ff41.tar.xz
Merge branch 'dfapi' of github.com:peterix/dfhack into dfapi
Diffstat (limited to 'package')
-rwxr-xr-xpackage/linux/dfhack19
1 files changed, 18 insertions, 1 deletions
diff --git a/package/linux/dfhack b/package/linux/dfhack
index 8484a3e5..35e9cfeb 100755
--- a/package/linux/dfhack
+++ b/package/linux/dfhack
@@ -2,6 +2,8 @@
# NOTE: This is dfhack's modification of the normal invocation script,
# changed to properly set LD_PRELOAD so as to run DFHACK.
+#
+# You can run DF under gdb by passing -g or --gdb as the first argument.
DF_DIR=$(dirname "$0")
cd "${DF_DIR}"
@@ -10,4 +12,19 @@ export SDL_DISABLE_LOCK_KEYS=1 # Work around for bug in Debian/Ubuntu SDL patch.
export LD_PRELOAD=./libdfhack.so
-./libs/Dwarf_Fortress $* # Go, go, go! :)
+case "$1" in
+ -g | --gdb)
+ shift
+ gdb ./libs/Dwarf_Fortress $*
+ ret=$?
+ ;;
+ *)
+ ./libs/Dwarf_Fortress $*
+ ret=$?
+ ;;
+esac
+
+# Reset terminal to sane state in case of a crash
+reset -I
+
+exit $ret