Help - Debugger Not Functioning Reliably?

Discussion in 'Mac Programming' started by kalimba, Jan 2, 2009.

  1. kalimba macrumors regular

    Joined:
    Jun 10, 2008
    #1
    First of all, let me state that I'm a complete newb to Mac/Cocoa programming. I'm working through both Kochan's and Hillegass' books, and I'm currently around chapter 3 of Hillegass, where he introduces the use of the debugger. As a professional software engineer, I understand the immeasurable value of a good debugger, but I'm seeing some strange behavior in the Xcode debugger.

    When I first followed the directions in Hillegass for setting a breakpoint and running the debugger, everything worked fine and as described. But whenever I try to run my app again, it just runs right through my breakpoint(s) without stopping at all. In the breakpoints window, I've verified that the breakpoints are enabled. I've tried clearing all breakpoints and setting new ones, but that doesn't change anything. The only thing that seems to fix this is restarting Xcode, but then I still only get one good "run" through the debugger before it stops working correctly.

    I've noticed that the "enabled" checkbox in the breakpoints window changes from a check to a minus sign after I try to run the debugger, which makes me think that Xcode no longer thinks the breakpoint is valid, but I don't know why this would be, nor how I can fix it.

    I realize the description of my situation might be vague, but does this sound like a familiar or common problem to anyone else?
     
  2. Catfish_Man macrumors 68030

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
    #2
    Are you building in debug mode rather than release mode? The debugger definitely behaves badly on release builds.
     
  3. kalimba thread starter macrumors regular

    Joined:
    Jun 10, 2008
    #3
    Yeah, I'm definitely running a DEBUG build, but that was a valid question, as the debugger appears to be ignoring the breakpoints as if they were on lines that had been optimized away in a release build.

    I seem to have remedied the problem by clearing all breakpoints, cleaning all targets, re-setting my breakpoints and recompiling my project. The debugger appears to be working as expected now.
     

Share This Page