gdb调试有管道的命令行

以pcre2调试为例

1
2
3
4
5
6
7
8
9
#!/bin/sh
 
cd `pwd`/installed/bin
 
mkfifo /tmp/pcre
echo "<h1>hello</h1>" > /tmp/pcre &
 
gdb ./pcre2grep -ex 'b main' -ex 'r -o "<.*>" < /tmp/pcre'
rm /tmp/pcre

refer to:
http://www.voidcn.com/article/p-migwptlv-bsq.html