Debugging in XCode 4.3 and why member variables don’t seem to resolve correctly

So you’re an early adopter, good for you, although many times it can bite ya in the behind. Xcode is a fickle mistress and the latest release of Xcode 4.3 is no exception. If you’re like me and you’ve got it installed and are cranking happily coding and debugging, you might have run into a strange phenomenon that the debugger doesn’t seem to show the variables and their values correctly. This caused me hours of heartache because I was thinking that I had something messed up with my inheritance in my classes and sent me down a wild goose-chase trying to track down why my members weren’t being initialized correctly. The it dawned on me, “hey I just updated to Xcode 4.3, I bet somethings up…” Ding ding ding, give the man a booby prize. The problem is the debugger and compiler settings. I changed my compiler to use the GCC compiler (“LLVM GCC4.2″) and the debugger to GDB and all was right in the world the next time around. After playing with the settings a bit more, turns out I didn’t need to change the compiler at all, just the debugger.

The short version of this post is, if you’re having difficulties debugging in Xcode 4.3, simply set your debugger to the GDB and you’re good to go.

Good luck and be safe out there!

2 Comments

  • Oleg

    March 20, 2012, 10:35 pm

    I encountered the same problem! I spent about 5 hours on it before I knew what the problem. Could you suggest how to change the debugger to gdb?

  • Alvaro

    August 2, 2012, 6:13 am

    Thanks, I was also having problems.

    Oleg, change it in the “Edit scheme…” section. From there, you will find it easily.

Comments are closed

Top