1

I am porting an iOS project to Android. I need to step through the methods in the Objective C classes to understand how they work and also to help with writing unit tests which will validate my ports. AppCode is my chosen weapon.

The problem is that whilst debugging, I often get "value temporarily unavailable due to optimisations" and I am unable to inspect most classes, lists and arrays.

I've opened the project in Xcode and set the compiler optimisations to "none" then opened it in AppCode. I've also tried opening the project in Xcode from within AppCode (File->Open project in Xcode). Despite the project properties showing no optimisations, I am still unable to view most variables. I also get variables repeated in the debug window and the execution point jumps all around the code when stepping. This leads me to believe that optimisations are still turned on.

I've tried with GDB and LLDB via debugging preferences in AppCode.

Can anyone rescue my sanity?

Thanks

Simon

Simon
  • 14,407
  • 8
  • 46
  • 61

1 Answers1

0

Have you checked that the Run/Debug configuration you're using (in AppCode) is a Debug (and not a Release) configuration? Run -> Edit configurations pops up a dialogue where you can edit each config. Make sure that the 'configuration' drop-down is set to 'Debug'.

Cris
  • 1,939
  • 3
  • 23
  • 37
  • Yeh, it's Debug. Actually, I have more testing to do then I'll come back with the answer if it's correct - which is to select the standard LLVM compiler rather than Apple's. To me at least, it seems that the Apple one does not obey optimisations->none. – Simon Aug 28 '12 at 21:44
  • That's unlikely to be the issue. The standard Xcode project templates set GCC_OPTIMIZATION_LEVEL to 0 for the Debug config. If this in itself caused a debugging problem, then Xcode users would be flooding Twitter. JetBrains has an [open bug database](http://youtrack.jetbrains.com/), and I haven't found anything like this there. Perhaps you could fill your question out with more details of your project and build settings? – Cris Aug 29 '12 at 06:55
  • Have you checked in the build log to see what optimisation level is actually being set by xcodebuild? – Cris Aug 29 '12 at 07:11