使用LLDB的Xcode 4.3中出现奇怪的错误信息 [英] Weird error message in Xcode 4.3 with LLDB

查看:172
本文介绍了使用LLDB的Xcode 4.3中出现奇怪的错误信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Xcode 4.3.2编写一个iOS应用程序。在我的代码的大部分部分,使用LLDB进行调试工作正常。然而,在某些时候,我在浏览我的代码时收到一个奇怪的消息。当我将鼠标悬停在iVar上时,它表示


错误[IRForTarget]:找不到Objective-C间接ivar符号OBJC_IVAR _ $ _ MyFancyClass。 iVar


而不是显示我的价值。但是,在变量视图中,我可以看到它很好。直到我选择打印描述... 就是这样,因为Xcode崩溃...
当我使用GDB时,悬停起作用但是类型并且变量的值是错误的。



我发现我的代码有问题,这又导致调试器失败。但代码运行正常。我想提供一些示例代码,但是类是相当长的,我无法确定我的修复的确切位置。所以有人遇到过类似的行为吗?



更新:实际上,似乎这在我的代码中发生了,而不仅仅是在一些具体的文件。如果它有帮助,而LLDB显示上述消息,GDB总是显示拥有iVar的Class的对象,而不是iVar本身。
看起来好像内存管理有问题。例如,如果我说了一些类似

  [notificationCenter addObserver:self selector:@selector(foo)name:bar object:objA ]; 

即使我有

  [notificationCenter postNotificationName:bar object:objB]; 


解决方案

此错误的原因是错误的构建设置,在问题的讨论中指出发表评论。通过将部署后处理设置为调试模式(默认值)可以解决此问题。


I am currently writing an iOS app with Xcode 4.3.2. In most parts of my code, debugging with LLDB works just fine. However at some point I am getting a strange message while stepping through my code. When I hover over an iVar, it says

Error [IRForTarget]: Couldn't find Objective-C indirect ivar symbol OBJC_IVAR_$_MyFancyClass.iVar

instead of showing me the value. However, in the Variables View, I can see it just fine. Until I'm selecting Print Description of ... that is, because then, Xcode crashes... When I use GDB, the hovering works but the type and values of the variable are wrong.

I recon that there is something wrong with my code which in turn causes the debuggers to fail. However, the code runs fine. I'd love to provide some samplecode but the class is rather long and I can't pinpoint the exact location of my screwup. So has anybody encountered a similar behavior?

UPDATE: Actually, it seems as if this happens everywhere in my code, not just in some specific files. If it helps, while LLDB show the above message, GDB always shows an object of the Class that is owning the iVar, instead of the iVar itself. It looks as if there is something wrong with the memory management. For example, if I say something like

[notificationCenter addObserver:self selector:@selector(foo) name:bar object:objA];

the selector is invoked even when I have

[notificationCenter postNotificationName:bar object:objB];

解决方案

The cause of this error are incorrect build settings, as indicated by the discussion in the question post comments. This can be fixed by setting "Deployment Postprocessing" back to NO for Debug-Mode (the default value).

这篇关于使用LLDB的Xcode 4.3中出现奇怪的错误信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆