gdb print 输出写到文件里 --- tee 命令可以解决

来源:互联网 发布:java多线程查询数据库 编辑:程序博客网 时间:2024/05/29 16:26
 

#! /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.txtgdb ./a.out | tee ./log.txt