Visual Studio 2010本地变量历史记录 [英] Visual Studio 2010 Local Variable History

查看:216
本文介绍了Visual Studio 2010本地变量历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调试一个具有许多嵌套循环的过程,这些循环会更改几个不同的局部变量.

I'm working on debugging a process which has a number of nested loops which change a couple different local variables.

我可以通过每次逐步迭代来观察它们,但是这很繁琐,而且我也找不到自己的位置.我根本没有时间每次都写下每个变量.

I can watch these by just stepping through...one iteration at a time, but it's quite tedious, and I'm losing track of my place. I simply don't have time to write down each variable, every single time.

有没有一种方法可以查看局部变量的历史记录?一个插件?有什么想法吗?

Is there a way that I can see the history of a local variable? A plugin? Any ideas if not?

推荐答案

如何使用

How about logging the variables inside the loop with Debug.WriteLine or Trace.WriteLine? Then you can inspect the results afterwards.

如果您只对运行中某些点的值感兴趣,则可以使日志记录依赖于布尔变量的值,并在调试器中手动将其打开和关闭.

If you're only interested in the values at certain points in a run, you could make the logging dependent on a Boolean variable's value, toggling it on and off manually in the debugger.

这篇关于Visual Studio 2010本地变量历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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