使用 Eclipse CDT 调试静态库
我正在努力使用 Eclipse CDT 进行一些嵌入式开发,但在对静态库进行源代码级调试时遇到困难。
我正在使用我自己的 Makefile,所以这是我现在的第一个怀疑,特别是因为 gdb 声称没有符号表信息可用于没有源的函数。使用静态库时,来自库的调试信息通常是否包含在最终链接阶段的 ELF 文件中?现在,如果我将 objdump -S 指向 .a 文件,我可以看到完整的源代码/程序集组合,但没有任何调试信息会进入 .elf。主应用程序存在调试信息/源。我是否缺少一些开关来告诉 ld 包含此内容?
否则,让 gdb 告诉我关于特定函数的调试信息正在寻找(和未能找到)的内容的最佳方法是什么。
I'm working on getting set with Eclipse CDT for some embedded development and I'm having difficulty getting source level debugging working for static libraries.
I'm using my own Makefiles, so that is my first suspect right now, especially since gdb claims that no symbol table info is available for the functions with no source. When using a static library, is the debugging information from the library usually included in the ELF file from the final link stage? Right now I can see the full source/assembly mix if I point objdump -S at the .a file, but none of the debug info makes it into the .elf. The debugging info/source is present for the main application. Am I missing some switch to tell ld to include this?
Otherwise, what is the best way to get gdb to tell me what is looking for (and failing to find) with regard to debug information for a specific function.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
想通了。
这个教训非常简单:总是,总是,三重检查你的 makefile。
仍在链接到没有调试信息的静态库的旧副本。
Figured it out.
The lesson is very simple: always, always, triple check your makefiles.
Was still linking in an old copy of the static library built without debugging information.
我猜想 GDB 根本找不到与该调试信息相关的源文件。请参阅http://web.mit.edu/gnu/doc/html /gdb_9.html#SEC51 有关如何告诉它在哪里找到源文件的文档。
I would guess that GDB is simply not finding the source files that go with that debug information. See http://web.mit.edu/gnu/doc/html/gdb_9.html#SEC51 for documentation on how to tell it where to find source files.