如何从.gdbinit强制断点? [英] How do I force a breakpoint from .gdbinit?
问题描述
当我使用以下方法在 .gdbinit
中设置断点时:
When I set a breakpoint in my .gdbinit
using:
b foobar
我明白了:
Function "foobar" not defined.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
现在第一行是可以理解的,因为该函数位于共享库中。但是,此默认设置为 no 。
Now the first line is understandable, because the function resides in a shared library. However, this defaults to no.
在这种非交互情况下,如何强制其设置断点?
How do I force it to set the breakpoint in such a non-interactive scenario?
推荐答案
这可以使用待设置的断点来完成。从设置断点文档:
gdb提供了一些附加命令来控制 break
命令无法将断点地址规范解析为地址时发生的情况:
gdb provides some additional commands for controlling what happens when the
break
command cannot resolve breakpoint address specification to an address:
设置断点等待自动
-这是默认行为。当gdb找不到断点位置时,它会询问您是否应创建挂起的断点。
设置断点挂起
-这表示无法识别的断点位置应自动导致创建挂起的断点。
设置断点挂起
-这表明将不创建挂起断点。任何无法识别的断点位置都会导致错误。
set breakpoint pending auto
- This is the default behavior. When gdb cannot find the breakpoint location, it queries you whether a pending breakpoint should be created.
set breakpoint pending on
- This indicates that an unrecognized breakpoint location should automatically result in a pending breakpoint being created.
set breakpoint pending off
- This indicates that pending breakpoints are not to be created. Any unrecognized breakpoint location results in an error.
这篇关于如何从.gdbinit强制断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!