在 Snow Leopard(基于 Lion 构建)上调试 OSX 程序
我有一个使用自动引用计数和 Lion SDK 构建的程序。该程序在 Snow Leopard 中的行为不符合预期(一个视图不会被加载,并且打开文档会挂起程序。)所以我想在那里调试它。但因为我无法在 Snow Leopard 下编译它,所以我不知道该怎么做。
那么我如何将调试符号放入 gdb 中或者我可以在 Xcode 中调试这个东西 - 是否可能有远程方式或类似的方式?
I have a program which I build using automatic-ref-counting and the Lion SDK. This program doesn't behave as expected in Snow Leopard, (One view won't be loaded and opening a document hangs the program.) so I want to debug it there. But because I can't compile it under Snow Leopard I have no idea how to do so.
So how do I get the debugging symbols into gdb or can I debug this thing in Xcode - is there probably a remote way or something like that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过 gdbserver 进行远程调试:
更简单的方法是将整个源代码和构建目录复制到 Snow-leopard 并在本地使用 GDB 进行调试。即使您没有在那里构建,GDB 仍然应该能够找到它需要的一切。
You can either debug remotely via
gdbserver
:A simpler way is to copy your entire source and build directory to snow-leopard and debug with GDB locally. Even though you didn't build there, GDB should still be able to find everything it needs.
抱歉,我的研究表明 Snow Leopard 上的“g++”编译器不再在链接模块中放置对“gdb”有任何含义的符号。唯一找到的符号是为使所有符号独一无二而创建的虚构符号。这是一个简短的示例:
Tiger 中的相同符号如下所示:
“签名”是“gdb”需要解决的问题,例如:break emsvc.c:DoSVC
此外,您仍然必须拥有所有“对象甲板”,例如 emsvc.o,因为 Snow Leopard 的“g++”显然不再携带链接模块中的符号。
我将一个在 Tiger(基于 Intel)上链接的“g++”编译模块带到了 Snow Leopard,没有对象平台,并且“gdb”能够完美地处理它,包括设置断点。显然,“g++”或链接器没有为 Snow Leopard 上的“gdb”生成正确的模块。
Sorry to say, my research shows that the "g++" compiler on Snow Leopard no longer places symbols in the linked module that have any meaning to "gdb". The only symbols found are the made-up symbols created to make ALL symbols unique. Here is a brief sample:
Those same symbols in Tiger were like this:
The "signature" is what "gdb" needs to resolve things like: break emsvc.c:DoSVC
Furthermore, you must still have all the "object decks", like emsvc.o, because Snow Leopard's "g++" apparently does not carry the symbols in the linked module anymore.
I brought a "g++" compiled module linked on Tiger (Intel-based) over to Snow Leopard without object decks, and "gdb" was able to handle it perfectly, including setting breakpoints. Apparently, "g++" or the linker isn't producing proper modules for "gdb" on Snow Leopard.