Visual Studio 2010 的局部变量报告不稳定
在我的一个名为 MoveMethod 的对象中,我有三个 TileGridArea,这是我创建的一种数据结构,用于存储相对于特定原点的列行对。
TileGridAreas 的操作相当基本,并且它们在该项目的许多其他区域中运行得很好,但是当我在 MoveMethod 中通过指针引用它们时,更改不会正确显示,因此它会搞砸所有寻路工作我正在努力实现。
我在此处第 25-27 行的构造函数中初始化了这三个值。
并在此处的第 2 行上专门执行第一个操作 编辑:似乎只允许 2 个显式链接(http://codepad.org/wXxBL7nb)
它正确地读取了 PreviewPath 为空,因此在第 5 行上执行了 addMember 函数我已经在调试中单步执行了它,并且完全没有理由不工作,但是当它从 addMember 函数返回到外部函数时,快速查看一下 本地窗口 显示,无论出于何种原因,它决定不添加到 PreviewPath,而是添加到 possibleDestinations。
这是 Visual Studio 的问题还是我的代码的问题?我发现当我所依赖的有关所涉及变量的准确信息的源完全错误时,调试对象的功能部分非常困难。
In one of my objects named MoveMethod, I have three TileGridAreas, a data structure I created for storing column-row pairs relative to a specific origin.
The TileGridAreas are fairly basic in their operation, and they function just fine in many other areas of this project, but when I refer to them by pointer within MoveMethod, the changes do not appear correctly, and as such it's gumming up all the pathfinding work I'm trying to accomplish.
I initialize the three in the constructor on lines 25-27 here.
And perform the first operation specifically on previewPath on line 2 here EDIT: only allowed 2 explicit links it seems(http://codepad.org/wXxBL7nb)
It correctly reads that previewPath is empty, and as such performs the addMember function on line 5. I've stepped through it in debug, and there is no reason at all for it not to work, but when it returns from the addMember function to the outer function, a quick look at the locals window shows that it has, for whatever arbitrary reason, decided to add not to previewPath but to possibleDestinations.
Is this an issue with visual studio or with my code? I'm finding it ridiculously difficult to debug the functional part of the object when the source I'm relying on for accurate information about the involved variables is flat out wrong.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对我来说效果很好。我将代码缩减为最小的可运行版本 - 您将来应该自己执行此操作。
Works fine for me. I cut down the code to the smallest runnable version - you should do this yourself in future.