4

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?

Amarsh
  • 11,214
  • 18
  • 53
  • 78

2 Answers2

5

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

Amarsh
  • 11,214
  • 18
  • 53
  • 78
  • Great, worked for me. In my case, i was using a custom scheme called mock (uses mock data). Does anyone know if we can turn on debugging of local variables for build configurations other than Debug? – Robert Wagstaff May 02 '13 at 00:45
1

It may also happen if you enable options like address Sanitizer in "Scheme > RUN > Diagnostics"

Diagnostics

vtruant
  • 273
  • 1
  • 12