4

Xcode 6 is completely ignoring my breakpoints. I saw a post here from 2008, but the answers are outdated, and don't seem to work.

EDIT:

This is happening only with projects that I start. All my downloaded open source projects work perfectly fine, as well as projects I started a few months ago.

UPDATE:

This is what I get when I create a brand new project and set a breakpoint in viewDidLoad

enter image description here

Community
  • 1
  • 1
MendyK
  • 1,643
  • 1
  • 17
  • 30
  • Did you close and reopen the xcode. This may fix the issue. – Arun Gupta Apr 27 '15 at 17:35
  • There's *a lot* of things to try in the page you link. The last comments of the [top answer](http://stackoverflow.com/a/67957/2227743) are from december and january. Does not look outdated to me. Did you try everything that's over there? – Eric Aya Apr 27 '15 at 17:35
  • @ArunGupta Tried that. It didn't work – MendyK Apr 27 '15 at 17:37
  • @ericd Yes, I spent 20 mins looking at every answer. Most of them didn't even apply to Xcode 6, and the ones that did, did not work – MendyK Apr 27 '15 at 17:39
  • Oh, ok. Good thing to know. Thanks. – Eric Aya Apr 27 '15 at 17:40
  • can you post code where a breakpoint is placed that xcode ignores? Also are you using the standard build settings? – R Menke Apr 27 '15 at 17:49
  • If you click on a breakpoint after you create it, the color goes muted and the app will skip over it when you run it. Have you ruled that out? – Adrian Apr 27 '15 at 18:21
  • @RMenke Using standard settings. Its happening in the `viewDidLoad` – MendyK Apr 27 '15 at 20:11
  • would it still be possible to post the code? If not at a println() at the point of the breakpoint. Does that work? If not the code is just not executed and the breakpoint obviously doesn't work either... – R Menke Apr 27 '15 at 21:41
  • 1
    Yes, I experienced the very same thing. After trying many, many things, I ultimately had to *completely* nuke Xcode (including removing everything in library, etc.) and reinstall from scratch. – Matthew Frederick Apr 27 '15 at 22:57
  • 1
    Might be unrelated, but I am also having issues with xcode. It almost looks like it cashes files. Sometimes a build doesn't check all files for changes and uses old data. Deleting all relevant files in the library and then performing a clean helps. Xcode has been extremely buggy since swift 1.2 came out. – R Menke Apr 28 '15 at 03:45

4 Answers4

4

After trying many different things, I ran

defaults delete com.apple.dt.Xcode

This reset my Xcode settings. Now when I create a new project, breakpoints work fine.

I realized that the problem happened when I added Cocoapods to the project. B/c right after I ran pod install, breakpoints stopped working. I'm not sure why.

Hope this helps anyone with the same problem

MendyK
  • 1,643
  • 1
  • 17
  • 30
2

I had a similar issue when I added a target to my project. Breakpoints placed in that target were ignored.

The solution was to set "Debug Information Format" in the new target's build settings to "DWARF with dysm"

In XCode 7.1 it defaulted to DWARF

Adam Ritenauer
  • 3,151
  • 4
  • 33
  • 40
1

There can be various culprits for this, a common one being setting the build scheme to Release instead of Debug.

For me it was the Debug Optimization Level set to -O0 in my target's build settings. Changing it to "Fast [-O, O1]" makes Xcode breakpoint-respectful again.

enter image description here

There is an interesting post about it here:

http://blog.credland.net/2014/03/xcode-debugger-why-do-you-stop-working.html

Rodrigo Pinto
  • 2,384
  • 22
  • 23
0

Close Xcode and remove the derived data and then reopen Xcode it will work

Sourabh Shekhar
  • 157
  • 1
  • 12