1

I have an app I'm developing where setting a breakpoint in Xcode while the app is running causes it to crash. At least I assume it is a crash. There is nothing in the console saying what happened. The app just terminates.

Note that the break point is not being hit, just the act of setting it causes this.

I've developed many apps and this is the first to act like this. Does anyone have any ideas what could be happening or how to figure this out? It is really slowing down my debugging.

btschumy
  • 1,435
  • 1
  • 18
  • 35
  • are you using GDB or LLDB + what version of ios and which xcode and what compiler – Daij-Djan Nov 29 '12 at 22:05
  • I know it's a silly question, but have you done the "Clean" command. When I see this 9 times out of 10, that fixes it. And in other cases, quitting and restarting Xcode can fix it. In rare cases, a reboot of the computer is needed. – Rob Nov 29 '12 at 22:05

1 Answers1

7

I'm assuming you're using Xcode 4.x. Try going into your scheme's settings and switch to a different debugger (GDB if you have LLDB currently set, or vice versa).

If that doesn't work, we need more info:

  • which version of Xcode and iOS are you using?
  • does the problem occur in the Simulator or on your device, or both?
  • have you tried placing a breakpoint in different places in your code?

As far as I can tell, it's a debugger issue. So your app does not actually crash, it's the debug session that crashes which causes the app to terminate. You can observe a similar effect when you hit Stop in Xcode or disconnect your device while an app is attached to the debugger in Xcode.

Might be an issue with mismatching Xcode and iOS versions. Please provide more info about your environment to help diagnose the problem.

Alexei Sholik
  • 7,287
  • 2
  • 31
  • 41
  • 1
    The debugger was set to LLDB whereas all my older projects were using GDB. After I switched to GDB the problem seems to have gone away. Yay! Thanks for the suggestion. For the record, I'm using Xcode 4.5.2 and debugging on an iPhone running iOS 4.3 (testing on older devices). – btschumy Nov 29 '12 at 22:35
  • So this must be a compatibility issue, i.e. new versions of LLDB might not work well with older versions of iOS. Thankfully, Apple hasn't deprecated GDB yet. – Alexei Sholik Nov 29 '12 at 22:39