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命令。我不确定为什么它不会继续并打印标签的值并继续循环。你能让我知道我做错了什么吗?