iPhone应用程序的Xcode调试速度慢慢 [英] Xcode debug with iPhone app is slow and laggy

查看:115
本文介绍了iPhone应用程序的Xcode调试速度慢慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调试我在Xcode中编写的iPhone应用程序,但有时候现在调试器(这是GDB)会减慢很多(进行一步一步的调试),有时候会变得无响应(用于进入的图标有时候它会恢复正常并继续,其他时候它永远保持如此,或在控制台中显示一条消息:超时(或类似的东西),我可以看到我的CPU从活动监视器上升到90%。作为一种解决方法,我曾经在我感兴趣的代码行之后添加了一个突破口,并且随着继续继续进行(这样做运行得很好,快速)。
这可以代码依赖吗?有没有办法调试调试器(行为)?



更新
完整的消息是

 超时取出数据。可变显示可能不准确。 

Googling为我发现,当Xcode gdb试图查看数据格式化程序时,会发生这种情况。有人建议禁用运行>变量视图>使用数据格式化程序(在xcode 3.2,以前我猜是Debug->变量
View->启用数据格式化程序),似乎也适用于我(直到现在)
现在我问:为什么? :D



UPDATE2
这解决了调试器停止在代码的特定部分,但是stil挂起相同的消息)在另一个呼叫。在我看来,这涉及到一些CoreData API,如(NSEntityDescription *)entityForName:inManagedObjectContext:



UPDATE3
最好缓存NSEntityDescription,而不是总是创建一个新的。

解决方案


I am debugging an iPhone app I'm writing in Xcode, but sometimes now the debugger (which is GDB) slows a lot (doing a step-by-step debugging) and becomes unresponsive sometimes (the icons for stepping-in, stepping-over, stepping-out are not clickable), after sometimes it gets back to normal and continues and other times it stay like that forever or a message appears in console: "Timed out" (or something similar) and I can see my CPU from activity monitor going up to 90%. As a workaround I used to put a brekpoint after the line of code I was interested in and simply went with 'Continue' to 'Continue' (doing so it run perfectly fine and fast). Can this be code dependent? Is there a way I can debug the debugger (behaviour) ?

UPDATE: The complete message is

Timed out fetching data. Variable display may be inaccurate.

Googling for it i discovered that it happens when Xcode gdb is trying to look inside data formatters. Someone suggested to disable Run>Variable View>Use Data Formatter (in xcode 3.2, previous i guess it is Debug->Variables View->Enable Data Formatters) and it seems to work for me too (till now) So now I am asking: why? : D

UPDATE2: This solved the debugger from stopping on a specific part of the code but it stil hangs (with the same message) in another calling. It seems to me that this involves some CoreData API like (NSEntityDescription*)entityForName: inManagedObjectContext:

UPDATE3: Would it be best to cache the NSEntityDescription instead of creating always a new one?

解决方案

So no one has an answer for this? In a short test turning off formatting might have helped (but the symptom is so random it's hard to say with any certainty). And the debugger is nearly useless without formatting.

这篇关于iPhone应用程序的Xcode调试速度慢慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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