从shell脚本启动GDB

Did*_*nov 2 linux shell terminal gdb

要开始调试,我需要执行以下步骤:

screen -S gdb_program gdb /path/to/program

handle SIGPIPE nostop noprint pass - 是gdb命令

c - 是gdb命令

如何编写一个我可以运行的shell脚本:

./gdb.sh

iab*_*der 5

使用Here Document:

#!/bin/bash
screen -S gdb_program gdb /path/to/program <<EOF
handle SIGPIPE nostop noprint pass
EOF
Run Code Online (Sandbox Code Playgroud)