如何在gdb脚本中回答Y? [英] how to answer Y in gdb script?
本文介绍了如何在gdb脚本中回答Y?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我以这种方式设置断点:
(gdb)break ParseDriver.cc:60
无源文件名为ParseDriver.cc。
在将来的共享库加载时使断点挂起? (y或[n])y
断点1(ParseDriver.cc:60)待处理。
为了简化设置断点,我写了一个简单的gdb脚本(名为breakpoints.gdb),它只包含只有一行:
break ParseDriver.cc:60
我在gdb终端中输入此脚本,但失败。
gdb)source〜/ breakpoints.gdb
没有名为ParseDriver.cc的源文件。
在将来的共享库加载时使断点挂起? (y或[n])[回答N;输入不是从终端]
似乎我们需要在脚本中回答Y以设置断点。
那么,如何在gdb脚本中回答Y?
谢谢你提前。
解决方案
(gdb)设置断点挂起
I use gdb to debug my cpp code. I set breakpoints in this way:
(gdb) break ParseDriver.cc:60
No source file named ParseDriver.cc.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (ParseDriver.cc:60) pending.
To simplify setting breakpoints, I wrote a simple gdb script(named breakpoints.gdb), it simply contains only one line:
break ParseDriver.cc:60
I source this script in gdb terminal, but it failed.
(gdb) source ~/breakpoints.gdb
No source file named ParseDriver.cc.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
It seems that we need to answer Y in script in order to set breakpoint.
So, how can I answer Y in gdb script ? Thank you in advance.
解决方案
(gdb) set breakpoint pending on
这篇关于如何在gdb脚本中回答Y?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文