debuggingxcode4.6

Xcode 4.6.1 debugger local variables not available


I recently upgraded Xcode 4.6 to 4.6.1, and I notice the following abnormal behaviour:

  1. Sometimes, Local Variables are not available upon a breakpoint

  2. Upon Step Into and Step Over when being suspended over a breakpoint, the editor highlights the incorrect line the code.

The LLVM 4.2 Compiler - COde Generation / Optimization level is set to None for Debug. I have tried cleaning the project, the simulator, etc. No luck.

Any clues?


Solution

  • The issue was that in my Run Configuration, I had chosen Release instead of Debug. Perhaps for Release, the compiler does some code optimisation, because of which, the compiled code and the source code get out of synch.

    Attached is where I had made a mistake:

    enter image description here