Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode is stopping at auto-continue breakpoints

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.

like image 840
William Jockusch Avatar asked Aug 29 '11 16:08

William Jockusch


People also ask

Why breakpoint is not working in Xcode?

See this post: Breakpoints not working in Xcode?. You might be pushing "Run" instead of "Debug" in which case your program is not running with the help of gdb, in which case you cannot expect breakpoints to work!

What is dotted breakpoint Xcode?

New in Xcode 13, if a breakpoint is not resolved to any location by LLDB, Xcode will show you a dashed icon. There is a myriad of reasons why a breakpoint is not resolved but there are some common explanations. If you hover over the unresolved breakpoint icon, we have a tooltip that can help you out.


3 Answers

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.

like image 59
an0 Avatar answered Sep 28 '22 03:09

an0


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

(Sorry my answer is not more helpful)

like image 27
deanWombourne Avatar answered Sep 28 '22 04:09

deanWombourne


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.

like image 40
chown Avatar answered Sep 28 '22 02:09

chown