CDT、SCons 和附加调试

发布于 2024-08-20 09:44:21 字数 571 浏览 2 评论 0原文

我对 Eclipse/CDT 开发很陌生,对 gcc/gdb 也不太有经验。

我的项目(共享库)是使用 SCons 在 Eclipse 中构建的。生成的 .so 位于 SCons 脚本的末尾,复制到其他位置(也许这是一个重要的点)。

我的应用程序是一个插件,用户必须在主机应用程序中加载。所以我想启动主机应用程序,加载我的插件/库,然后将调试会话附加到主机应用程序(我认为这就是我应该做的)。

我创建了一个调试配置。我选择“C/C++ Attach to Application”来创建我的配置。在主选项卡中,我设置了我的项目、构建配置(调用 SCons 脚本),对于“C/C++ 应用程序”,我设置了主机应用程序的路径。

但这是行不通的。可能是因为生成的.so 的位置。在构建器设置中,构建位置为 ${workspace_loc:/myProjectName}。我不理解这种语法,即使我理解workspace_loc 代表我的项目根。无论如何,iot 与 SCons 文件生成 .so 的位置无关。也许这就是问题的根源?

感谢您的帮助。 Eclipse 文档对这些要点非常详细。

更新:我收到以下错误: ptrace:不允许操作。

I am new to development in Eclipse/CDT, and not very experienced with gcc/gdb.

My project (a shared library) is built in Eclipse by using SCons. The generated .so is at the end of the SCons script copied to an other place (maybe it's an important point).

My application is so a plug-in that the user must load in the host application. So I want to launch the host application, load my plug-in/library, and then attach the debug session to the host application (I think that's what I am supposed to do).

I created a debug configuration. I chose "C/C++ Attach to Application" to create my configuration. In the main Tab, I set my Project, the Build Configuration (calling the SCons script), and for "C/C++ Application", I put the path to the host application.

But that doesn't work. Maybe because of the location of the generated .so. In the Builder Settings, the Build Location is ${workspace_loc:/myProjectName}. I don't understand this syntax, even if I understand workspace_loc stands for my project root. Anyway, iot isn't related where the SCons file generates the .so. Maybe that's the source of the problem ?

Thanks for your help. The Eclipse documentation is pretty porr about these points.

Update : I get the following error :
ptrace: Operation not permitted.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

会发光的星星闪亮亮i 2024-08-27 09:44:21

嗯,实际上,它确实有效。但没有好。
gdb 需要大约 15 秒才能附加到主机进程。

在此延迟之后,我得到以下跟踪:

.gdbinit: No such file or directory.
(no debugging symbols found)
attach 25678
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)

但我仍然无法调试:我必须执行“恢复”,因为附件完成后 gdb 停止,主机应用程序冻结。所以我以为是崩溃了。

我仍然需要找出为什么附加时间这么长。

Well, actually, it does work. But no well.
gdb takes about 15 seconds to attach to host process.

After this delay, I get this trace:

.gdbinit: No such file or directory.
(no debugging symbols found)
attach 25678
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)

But I still cannot debug: I have to do a "Resume", because gdb is stopped when the attachment is finished, with the host application frozen. So I thought it was crashed.

I so still have to find why it is so long to attach.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文