Corrupted stack/heap under debugger when simulating?

…衆ロ難τιáo~ 提交于 2019-12-02 06:00:19

问题


I'm using Xcode 6.3.1. I'm trying to track a weird issue in an app and now I'm seeing that local variables seem to be incorrectly initialised. When I hit a breakpoint at the line where a local variable is defined and initialised at the same time, it is actually shown as an existing local variable, but with a corrupt value:

Has anyone else seen this? In another run the variable was actually showing in the variable view as being an NSDate !!!


回答1:


A breakpoint is actually before the line it appears on; that line has not yet executed. You are thus looking too soon at this variable. It has no meaningful value until after you step past the line where it is initialized. You are still before that line so its value is random garbage.



来源:https://stackoverflow.com/questions/29863431/corrupted-stack-heap-under-debugger-when-simulating

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!