模拟时调试器下的堆栈/堆栈损坏? [英] Corrupted stack/heap under debugger when simulating?

查看:180
本文介绍了模拟时调试器下的堆栈/堆栈损坏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Xcode 6.3.1。我试图在应用程序中跟踪一个奇怪的问题,现在我看到局部变量似乎被错误地初始化了。当我在同一时间定义和初始化一个局部变量的行中点一个断点时,它实际上显示为一个现有的局部变量,但是具有一个破坏的值:





有没有人看到这个?在另一个运行中,变量实际上在变量视图中显示为NSDate !!!

解决方案

断点实际上在线出现在;该行尚未执行。因此,您在这个变量上看起来太早了。在 之后之前过去初始化的行之前,它没有意义的价值。您仍然在该行之前,所以它的值是随机垃圾。


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 !!!

解决方案

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.

这篇关于模拟时调试器下的堆栈/堆栈损坏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆