So, this has happened a number of times in a number of different projects. I'll be debugging my app in Xcode, when Xcode breaks on an error. After looking at it, I'd hit Step Over or Continue...and it wouldn't do anything. More accurately, it acted like it stepped, but didn't actually go anywhere. This can be repeated indefinitely, as far as I can tell. One reason this is problematic is that it never gives me the crash log, because it never finishes crashing. I only get the crash log when the app crashes and it isn't being debugged (which means I have to get it through Crittercism or by checking the device logs).
Anybody see this before, and/or know why it does this? I haven't seen any mention of this elsewhere, but it's happened to me in several projects.
For example, in one project we use SocketRocket, and every once in a while (for an as-of-yet unknown reason) it crashes in SRWebSocket.m in the following method:
- (void)main;
{
@autoreleasepool {
_runLoop = [NSRunLoop currentRunLoop];
dispatch_group_leave(_waitGroup);
NSTimer *timer = [[NSTimer alloc] initWithFireDate:[NSDate distantFuture] interval:0.0 target:nil selector:nil userInfo:nil repeats:NO];
[_runLoop addTimer:timer forMode:NSDefaultRunLoopMode];
int i = 0;
while ([_runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]) {
NSLog(@"_runLoop %i %@", i++, [NSDate date]);
}
assert(NO);
}
}
It crashes on the while
line. (I added the NSLog line, by the way). When I hit Continue or Step Over, the line indicator flickers briefly, then appears again on the same line. Note that it does not continue to the NSLog line, and nothing is written to the console at all. I'm currently still trying to get it to crash again (this particular crash is rather unpredictable), but if I remember correctly, the line indicator says EXC_BAD_ACCESS
, probably a prematurely deallocated object.
Using the Xcode Organizer Open the Xcode Organizer window. (Window menu -> Organizer, or Cmd-Shift-2.) Find your device in the left sidebar, then select “device logs”. Choose a Chrome crash (or multiple crashes) and select “Export” at the bottom of the Organizer window.
When you run an application in Xcode, the debugger is automatically started and attached to the process of the application. Click the Run button in the top left or press Command + R. From the moment the application is up and running, we can start inspecting the process and, if necessary, debug it.
The “Debug executable” checkbox specifies whether or not you want to run with the debugger enabled. Once running, you can use Debug > Attach to Process on a process that has been launched with debugging disabled if needed. It seems like all this does is start your app with the debugger attached.
You're missing the point of Step Over. When you step over a line, you're saying execute the current line and go to the next visible one, regardless off whether the current line calls another procedure.
If the code crashes at any point, you will not be able to continue executing lines of code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With