问题很简单。我的插件由 Firebreath 创建,我想在 Linux 中使用 gdb
调试我的 *API.cpp 文件。
是的,我已经阅读了this文章,我得到了这个 PID:
30227 0.0 0.4 115024 12300 pts/2 Sl+ 00:03 0:00 /usr/lib/chromium/chromium --type=plugin --plugin-path=/home/USER/Documents/mycode/0.1/npMyPlugin.so
当我用 gdb
打开时,我总是得到类似这样的输出:
Reading symbols from /usr/lib/libpcrecpp.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libpcrecpp.so.0
Reading symbols from /usr/lib/libssh2.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libssh2.so.1
Reading symbols from /usr/lib/libssl.so.1.0.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libssl.so.1.0.0
Reading symbols from /usr/lib/libcrypto.so.1.0.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libcrypto.so.1.0.0
可能不是正确的过程。有什么想法吗?
提前致谢。
更新 - 忽略消息 谢谢你们的评论。好吧,我忽略了这条消息并做了以下事情:
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n)
Program not restarted.
(gdb) b 328
No line 328 in the current file.
Make breakpoint pending on future shared library load? (y or n)
所以基本上 gdb
加载我的 MyPlugin.cpp 而不是我的 MyPluginAPI.cpp。有什么想法吗?
最佳答案
仅当您只有一个源文件时,仅使用行号设置断点才有效。
使用例如b MyPluginAPI.cpp:328
或 b MyPluginAPI::myMethod()
代替。
关于c++ - 在 Linux 中使用 gdb 调试 Firebreath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10185301/