Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode debug with iPhone app is slow and laggy

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?

like image 315
rano Avatar asked Jul 12 '10 06:07

rano


People also ask

Can you debug on iPhone?

Here's how: Open the iPhone Settings menu. On an iPhone with an early version of iOS, access the Debug Console through Settings > Safari > Developer > Debug Console. When Safari on the iPhone detects CSS, HTML, and JavaScript errors, details of each display in the debugger.


1 Answers

I have observed very slow debugging when 'Queue Debugging' is enabled in the scheme. If you don't need queue debugging, consider disabling it.

like image 193
deepwinter Avatar answered Sep 18 '22 16:09

deepwinter