1

我正在尝试使用 gdb 调试程序的插件。我之前看到一个问题,表明 gdb 中的目录命令可能会有所帮助。我认为这会有所帮助,因为当我尝试在插件的代码中设置断点时,我收到错误消息:“没有名为的源文件...”当我使用目录时它似乎没有做任何事情带有源路径结构的命令。有任何想法吗?谢谢。

4

1 回答 1

3

"No source file named..."

GDB will not be able to set a breakpoint until your plugin is actually loaded into the inferior (being debugged) process.

Use (gdb) info shared command to check whether your plugin is already loaded or not.

If it isn't, you can set a "deferred" breakpoint (GDB should be asking you whether you want to set such a breakpoint, assuming you have the default set confirm on setting).

If your plugin is already loaded and visible in info shared output, then you haven't built your plugin with debug info. Rebuild it with -g, and you should be able to set breakpoints in it.

于 2012-06-06T23:37:45.507 回答