8
votes

When I set a breakopint in my project, and click the "continue after evaluating all actions" checkbox, Xcode does not continue. Not only that, execution frequently appears to hang. This is true regardless of whether or not I actually have any actions on the breakpoint.

My non-autocontinue breakpoints work fine.

I tried a brand new project and the problem still occurred. So it must be related to a setting in either my computer or Xcode. I am using Snow Leopard and Xcode 4.0.2.

What could be the matter?

EDIT: code and console log.

code:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    [self.window makeKeyAndVisible];
    int x = 5;
    printf("%d", x);   // breakpoint here with autocontinue checked and no action
    x+=2;
    printf("%d", x);
    return YES;
}

console log:

This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all
Attaching to process 87901.
Pending breakpoint 1 - ""AutocontinueTestAppDelegate.m":21" resolved
Current language:  auto; currently objective-c
57

It is interesting that even though the optimization was set to none, both printf statements fired.

4
Your title and description seem to be at odds. Is the problem that "Xcode [is] stopping at auto-continue breakpoints" or that "Xcode does not stop"? If it's the former, I've got the exact same issue and am hopeful that you get a good answer! - clozach
Does this occur in Xcode 4.1? - Beltalowda
I actually think @deanWombourne might be right: probably a bug. Here's a test I just did: 1) set a breakpoint somewhere in a button action 2) edit & set to play a sound + auto-continue 3) run the app: the app pauses when I tap the button in the simulator. 4) drag the breakpoint down a line: the app continues, the simulator comes to the foreground, and subsequent taps play the sound without pausing. - clozach

4 Answers

2
votes

If you are running your app on device, I just got this for you: Currently, auto-continue breakpoints only work on simulator, no on devices.

Source: some Apple engineer.

1
votes

From what you describe, it sounds like it might be a bug in Xcode - report it here.

(Sorry my answer is not more helpful)

1
votes

Can you paste your console log. Check that your 'Condition' and 'Action' are valid and without error. I just tested this with an action of resetAllAppData == NO but the breakpoint did not halt execution because the 'Action' needs to be 'resetAllAppData == false'.

This is the console log of another test:

Attaching to process 23361.
warning: Error parsing breakpoint condition expression
Pending breakpoint 1 - ""iPhoneAppDelegate.m":50" resolved

I got this error because I set the "Action" of the breakpoint to be the "Debugger Command" po resetAllAppData and since resetAllAppData is not an Object typedef signed char BOOL; it cannot execute the action and subsequently does not stop at the breakpoint.

0
votes

This was happening to me, too. I noticed that at a given breakpoint it would only stop occasionally. The breakpoint was logging a BOOL to console using po. Inspecting it I noticed that it would stop whenever that BOOL was 1 it would stop and append to the log [no Objective-C description available]. Changing it to something that prevented that no-description-available "bug" resulted in auto continuation.

So now I'm using something like:

po (NSString *)[NSString stringWithFormat:@"%d", isCenterActive]

There might be a better and shorter solution, though.