过去的情况是,如果尝试在未定义的符号上设置断点,gdb无论如何都会提供设置断点,以防稍后动态加载。
然而,在gdb 8.3-6中,这种情况不会发生。
(gdb) break foo
Function "foo" not defined.
我的用例是,我需要调试一个JIT编译函数,它将在被程序本身编译后被动态加载。如何在这样的函数上设置断点?
这是在Fedora /Linux 30上。
发布于 2019-07-26 11:16:31
默认情况下,当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.
该查询如下所示:
Make breakpoint pending on future shared library load? (y or [n])
但是,如果禁用了set confirm off
的确认,则可能不会发生这种情况。
因此,您可以使用set confirm on
启用确认(如果以前已经禁用了它们),或者始终可以使用set breakpoint pending on
在未识别的断点位置设置挂起断点。
https://stackoverflow.com/questions/57216044
复制相似问题