Corrupted stack/heap under debugger when simulatin

2019-02-27 20:26发布

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:

corrupt initial value for xview local variable - which shouldn't be defined yet

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

1条回答
家丑人穷心不美
2楼-- · 2019-02-27 21:22

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.

查看更多
登录 后发表回答