#! /bin/sh
# gdb.sh
(gdb |tee newfile )<< GDBEOF
file ./lce_conv_tp
set print null-stop on
set print pretty on
set listsize 1000
b 150
r
p ((Flcem_shelfall_ispf*)inBuf)->shelfdt[0] ###这里我想把结构写入一个文件,不知怎么做
GDBEOF
另外种方法
比如调试程序./a.out, 保存信息到文件./log.txt gdb ./a.out | tee ./log.txt