What is up.
RSS icon Email icon Home icon
  • Problem with breakpoints in Xcode

    Posted on September 6th, 2007 Alan 12 comments

    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 responses to “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. < < Turning off "Load symbols lazily" >>

      Was most helpful. Thank you.

    4. This post showed at second position for google query [xcode debug breakpoint stop]. Thank you, Aaron, your advice worked!

    5. #1 Google hit for “xcode breakpoint”

      Thanks a ton, Aaron!

    6. Thanks, Aaron, this was driving me crazy ;-)

    7. 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.

    8. Nice one!

    9. 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.

    10. You are a star Aaron! This was driving me frickin bonkers and your advice relieved me of my torment :)

    11. Cheers, breakpoints now working as expected ! Thanks for the tip.

    12. 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

    You must be logged in to post a comment.