c++ - 在 Linux 中使用 gdb 调试 Firebreath

标签 c++ plugins gdb firebreath

问题很简单。我的插件由 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:328b MyPluginAPI::myMethod() 代替。

关于c++ - 在 Linux 中使用 gdb 调试 Firebreath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10185301/

相关文章:

c++ - 标准库实现专门化以具有子概念的概念为模板的函数是否合法?

c++ - Sprite 作为全局变量?

javascript - 将 jquery 插件配置存储在数据中是一种好习惯吗?

c++ - 如何在 C++ 中查看 <optimized out> 变量的值?

c++ - 声明与实例化

c++将地址位置视为整数

plugins - 简单的 Rails 3 CMS Gem/插件?

cocoa - Mac OSX、NPAPI 中的 Cocoa 事件模型、NSView 和进程外插件

c - GDB 在内核中打印错误的参数值

c++ - 在 emacs 中执行多个 gdb 命令