高手请进,gdb管道命令后自动退出

heronism 2017-04-07 11:56:51
centos 6.5系统,执行echo "bt"|gdb --quiet -nx /proc/10214/exe 16691后,打印出bt命令的结果后自动quit。如下:
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
0x0ffd6cf4 in read () from /lib/libpthread.so.0
(gdb) #0 0x0ffd6cf4 in read () from /lib/libpthread.so.0
#1 0x0fe6fd58 in rl_getc () from /lib/libreadline.so.6
#2 0x0fe6fc9c in rl_read_key () from /lib/libreadline.so.6
#3 0x0fe4b3f8 in readline_internal_char () from /lib/libreadline.so.6
#4 0x0fe4b5c8 in ?? () from /lib/libreadline.so.6
#5 0x0fe4b61c in ?? () from /lib/libreadline.so.6
#6 0x0fe4ae3c in readline () from /lib/libreadline.so.6
#7 0x10546bbc in main_read (procName=0xbfb99eb0 "./app") at ../source/test_common_shell.c:773
#8 0x105c1898 in app_main (argc=2, argv=0xbfb99c34) at ../source/test_win_entry.c:289
#9 0x1054ba00 in main (argc=2, argv=0xbfb99c34) at ../source/test_common_watchdog.c:873
(gdb) quit
A debugging session is active.

Inferior 1 [process 1973] will be detached.

Quit anyway? (y or n) [answered Y; input not from terminal]
Detaching from program: /proc/1973/exe, process 1973

我的问题是,按照管道的理解不是应该只输出bt的打印,后面的quit和y的输入管道里明明没有啊,是哪个环节输入给gdb的呢(看样子应该是gdb自己),这里面的原理是什么,请高手帮忙分析下,谢谢
...全文
1233 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
heronism 2017-11-09
  • 打赏
  • 举报
回复 1
呼唤高手,结贴给分。

4,441

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧