Problem with breakpoints in Xcode

Problem with breakpoints in Xcode

I'm running Xcode 2.4.1

I have an odd breakpoint problem that I have not seen written about. I can set breakpoints no problem, my program will break correctly. My problem is when I run my program again, though the breakpoints appear marked correctly in the UI and in the breakpoint window, none of the breakpoints break.  Going to the command-line GDB (GNU debugger) via <Option><Apple> (must be in the debugger window) I type in "break info" and it reports no breakpoints!

Don't know what happened in my environment for this to start occuring but it is very inconvenient to re-enter all my breakpoints on each invocation.  I hope I find the problem soon.

Update: I found the "Stop on Debugger()/DebugStr()" command in the Debug window.  This will save me, for now, allowing me to break inside some initialization code which runs before I get a chance to set breakpoints.  I just insert a Debugger(); call in the code where I want to "break".

Update:  Today,  Aug 26, 2008, "xcode breakpoint" is appearing at #1 in Google.  In case you aren't reading the comments to this post,  Aaron's suggestion:

"In xcode go to Preferences, select the page for Debugging then make sure "Load symbols lazily" is NOT selected"

seems to fix many of the breakpoint issues for most people.  It didn't address my particular issue that I described in the post (I think my project has gotten corrupted or something), but it did help me in other instances.

12 thoughts on “Problem with breakpoints in Xcode

  1. Breakpoints stop working?

    In xcode go to Preferences, select the page for Debugging then make sure “Load symbols lazily” is NOT selected.

    This was driving me friggin nuts!

  2. Thanks Aaron. Turning off “Load symbols lazily” DOES appear to help. I’ll have to see if it fixes all my breakpoint issues. I’m also finding it hard to break in multiple threads.

  3. Again, Aaron, Thanks. Your comment helped me too.
    An observation about when the breakpoints were being ignored: I noticed that in the xcode editor, breakpoints were solid blue as usual when I set them. But as soon as I ran my app, the breakpoints all turned an amber-ish color. Once I unset “Load symbols lazily” the breakpoints both worked *and* remained blue while the app ran. This seems to be an indicator of the useless state of the breakpoints, but not a very helpful one.

  4. Great! Thank you for your tip with those “lazy symbols”.
    For me the breakpoints it set sometimes were not recognized. And if the processor reaches a breakpoint that was deleted before, the gdb jumped in.

    Now after disabling the option it’s working.

  5. Actually in 3.1.2 and above I have not experienced much problem with the lazy settings in preferences.

    However. There is another issue. Make sure
    Debug Information Format is set to:

    DWARF with dSYM File

    Right click on the target>get info and set in buid preferences.

    This fixed it for me.

Leave a Reply