gdb - 如何从.gdbinit强制断点?

标签 gdb breakpoints

当我使用以下命令在.gdbinit中设置断点时:

b foobar

我得到这个:
Function "foobar" not defined.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]

现在第一行是可以理解的,因为该函数位于共享库中。但是,默认为否。

在这种非交互情况下,如何强制它设置断点?

最佳答案

这可以使用set breakpoint pending on完成。从Setting Breakpoints文档中:

gdb provides some additional commands for controlling what happens when the break command cannot resolve breakpoint address specification to an address:

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.

关于gdb - 如何从.gdbinit强制断点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28769956/

相关文章:

gdb - 如何将整个GDB session 转储到文件中,包括我键入的命令及其输出?

gdb - 查找密码

debugging - 如何在经典 ASP 中设置断点? (IIS7/VS2010)

python - IPython - 在导入的文件中设置断点

c++ - 无法在Mac OS X上的Visual Code中调试C++

无需源代码即可调试程序(Unix/GDB)

IOS 攻击者可以看到多少我的方法?

visual-studio - Visual Studio : How to stop breakpoint hit from stealing focus?

c - 试图了解我的代码中的问题

visual-studio-2010 - Visual Studio - 一些断点没有中断