浏览代码

- Did some testing and fixed a bit the updated tools/stackdump script.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7297 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 年之前
父节点
当前提交
3956b24786
共有 1 个文件被更改,包括 7 次插入9 次删除
  1. 7 9
      tools/stackdump

+ 7 - 9
tools/stackdump

@@ -27,17 +27,15 @@ case "$1" in
 esac
 esac
 
 
 # Check if server file needs .exe (Windows/Cygwin)
 # Check if server file needs .exe (Windows/Cygwin)
-if [ ! -e $SERVER ]; then
-	if [ -e $SERVER.exe ]; then
-		SERVER=$SERVER.exe
-	else
-		echo Error: $SERVER not found!
-		exit
-	fi
+if [ -e $SERVER.exe ]; then
+	SERVER="$SERVER.exe"
+elif [ ! -e $SERVER ]; then
+	echo Error: $SERVER not found!
+	exit
 fi
 fi
 
 
 # Assemble stackdump filename
 # Assemble stackdump filename
-if [ $# > 2 ]; then
+if [ $# -gt 2 ]; then
 	STACK="$SERVER$3.stackdump"
 	STACK="$SERVER$3.stackdump"
 else
 else
 	STACK="$SERVER.stackdump"
 	STACK="$SERVER.stackdump"
@@ -57,7 +55,7 @@ fi
 
 
 # Finally dump the backtrace
 # Finally dump the backtrace
 # If number is given, Sig-plugin format. otherwise, standard stackdump format
 # If number is given, Sig-plugin format. otherwise, standard stackdump format
-if [ $# > 2 ]; then
+if [ $# -gt 2 ]; then
 	awk '$2 ~ /[0-9a-eA-E]\]$/{print $2}' $STACK | tr -d \[\] | addr2line -f -e $SERVER 
 	awk '$2 ~ /[0-9a-eA-E]\]$/{print $2}' $STACK | tr -d \[\] | addr2line -f -e $SERVER 
 else
 else
 	awk '/^[0-9]/{print $2}' $STACK | addr2line -f -e $SERVER
 	awk '/^[0-9]/{print $2}' $STACK | addr2line -f -e $SERVER