0
我正在編寫腳本來檢查覈心轉儲。目標是使用while循環執行gdb命令進行分析。在gdb腳本中使用while循環
#!/usr/local/bin/bash
#
# A script to extract core-file informations
#
#Binary image
binimg=$1
# Today and yesterdays cores
core=$2
gdblogfile=$3
loop = 3
gdb -batch \
-ex "set logging file $gdblogfile" \
-ex "set logging on" \
-ex "set pagination off" \
-ex "file $binimg" \
-ex "core-file $core" \
-ex "bt" \
-ex "frame 8" \
-ex "while $loop > 0 { print this->_tag; set $loop = $loop - 1; end }"
-ex "quit"
此腳本不while循環後執行。它停在while循環中,期待命令行gdb命令。我不確定爲什麼它不會繼續並打印標籤的值並繼續循環。你能讓我知道我做錯了什麼嗎?