optimization - stepping may behave oddly : iOS/Unity optimization - stepping may behave oddly : iOS/Unity swift swift

optimization - stepping may behave oddly : iOS/Unity


The code you're debugging is IL2CPP code, which is likely in a library prebuilt with optimizations (probably in libiPhone-lib.a). Your build settings only effect the code being compiled now in your xcode project, so they wouldn't effect a prebuilt lib. To get rid of the warning, you will need to rebuild that library, and you will need Unity source code to do that.

More importantly, it's not the cause of the crash. It's just telling you that it's going to be harder to find the source of the crash.

It looks like it's calling a function called LoadMetadataFile and crashing when accessing the return. You can probably set a breakpoint on that function call and see what's going in and out of it to find the next debugging step (the bl instructions 5 lines above the highlighted crashing line).

Here are some documents that might help you:Apples calling convention docs: https://developer.apple.com/library/content/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARM64FunctionCallingConventions.html

Arm instruction reference (opened to the crashing instruction): http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0802a/LDRSW_imm.html


I had the same issue and I solve it adding to Apple LLVM - Custom Compiler FLags:

Other C Flags: -DRUNTIME_IL2CPP=1