问题
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?
回答1:
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.
回答2:
May not be helpful in your case, but Debugger Canvas is pretty neat. It visually shows you the call-chain and allows you to "get an overview over recursive calls by showing one bubble per invocation"... check it out :)
来源:https://stackoverflow.com/questions/12714710/visual-studio-2010-local-variable-history