Xcode,某些子类没有调试符号
我正在使用 Xcode 3.2.3 和 iPhone SDK
所以我试图调试 UIView 子类,我在重写方法中遇到了断点,并且在 GUI 或 gdb 中看不到任何符号,只有全局变量和寄存器。
这就是我所看到的:
(gdb) po self
No symbol "self" in current context.
然而,当我在 UIViewController 子类中设置断点时,所有符号都在那里:
(gdb) po self
<MyViewController: 0x5c18ae0>
Current language: auto; currently objective-c
我尝试过的一些操作:
- 清理全部/重建
- 重新启动 Xcode
- 在调试和发布之间进行更改
- 配置项目中的这些选项 设置:
- GCC_DEBUGGING_SYMBOLS = 全部
- 符号DEBUG_INFORMATION_FORMAT = DWARF,带有 dSYM 文件的 DWARF
- BUILD_VARIANTS = 正常,调试
- 通过咒骂并输入来调试威胁 Xcode
rm -rf /Developer
进入 root bash 提示
请帮忙,我的手指因使用 NSLog 调试而流血
I'm using Xcode 3.2.3 and iPhone SDK
So I'm trying to debug a UIView subclass, I hit a breakpoint in an overridden method and I can't see any symbols in either the GUI or gdb, just globals and registers.
This is what I see:
(gdb) po self
No symbol "self" in current context.
Yet when I set a breakpoint in a UIViewController subclass, all the symbols are there:
(gdb) po self
<MyViewController: 0x5c18ae0>
Current language: auto; currently objective-c
Some things I've tried:
- clean all/rebuild
- restart Xcode
- change between debug and release
- config these options in Project
settings:- GCC_DEBUGGING_SYMBOLS = All
- Symbols DEBUG_INFORMATION_FORMAT = DWARF, DWARF w/ dSYM File
- BUILD_VARIANTS = normal, debug
- threatening Xcode by swearing at it and typing
rm -rf /Developer
into a root bash prompt
Please help, my fingers are bleeding from debugging with NSLog
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我经常遇到这个错误。我的解决方法是在 gdb 控制台上输入 bt 命令,然后它会自动排序并开始识别当前上下文中的符号。
I experience this bug often. My workaround is typing the bt command on the gdb console, it then automagically sorts itself out and starts recognizing symbols in the current context.
因此,从调试更改为发布就成功了,我拥有了所有调试符号。
我认为这只是 4.0 SDK 中的一个错误。
So changing from Debug to Release did the trick and I have all my debug symbols.
I think it's just a bug in the 4.0 SDK.
嗯,尝试在 3.2.3 和 SDK4 Final 中重现这一点,但没有成功——能够按预期调试 UIView 子类。使用 Beta 版本之一是否会发生这种情况?
Hmmm, tried to repro this in 3.2.3 and SDK4 Final with no success -- able to debug UIView subclass as expected. Is this occurring using one of the beta releases?
发生在我身上的是非测试版本。我只是注意到它只在调用类定义的方法时发生,即(+)而不是(-)
我不介意没有“self”指针,但它似乎也清除了调试器中的所有局部变量显示,这是错误的。
Happening to me, on a non-beta release. I just noticed that it only occurs when calling a class-defined method, ie (+) not (-)
I wouldn't mind not having a "self" pointer, but it also seems to wipe out all local variable displays in the debugger, and that is just wrong.
MTS 的方法对我很有效。从调试更改为发布修复了此问题。多么奇怪啊。我可以反驳软件进化的理论,因为我在实例方法中遇到了错误。
MTS' method worked for me. Changing from debug to release fixes this issue. How strange. I can disprove software evolved's theory, as I experience the error inside an instance method.
在 gdb 中输入 bt。
如果您在任何地方看到 self= ,这是因为 xcode 已设置为优化。
转到构建设置并输入优化。
如果调试或发布的优化级别设置为最快,则会导致您的问题。
应以最快的速度发布,以便您的代码在构建分发时运行良好。最好在方案中更改您的构建配置。
选择+单击“运行”按钮。在左侧单击“运行 YourAppsName.app”,然后单击“信息”并选择调试。
in gdb type bt.
If you see self=<value temporarily unavailable, due to optimizations> anywhere it's because xcode has been set to be optimized.
Go to the build settings and type optimization.
If optimization level for either debug or release is set to Fastest that's causing your issue.
Release should be left at fastest so your code run well when building for distribution. It's better to change your Build Configuration in Scheme.
opt+click the Run button. On the left click Run YourAppsName.app, then Info and select debug.