I am trying to debug, with gdb, a plugin to a program. I saw a question earlier that indicated that the directory command in gdb might help. I thought it would help because, when I try to set a breakpoint within the code of the plugin, I get the error that says: “No source file named…” It didn’t seem to do anything when I used the directory command with the source path structure. Any ideas? Thanks.
Share
GDB will not be able to set a breakpoint until your plugin is actually loaded into the inferior (being debugged) process.
Use
(gdb) info sharedcommand 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 onsetting).If your plugin is already loaded and visible in
info sharedoutput, then you haven’t built your plugin with debug info. Rebuild it with-g, and you should be able to set breakpoints in it.