In visual studio, is there a way to step back to see what the few lines executed before were? I hit an unhandled exception in my code, and what I would like to do is step back (without re-executing) so I could see the class/method that called the method that threw the exception. This is in C#
views:
211answers:
2
+8
A:
Debug -> Windows -> Call Stack (Ctrl + Alt + C is default bindings (I think))
Will show you the history of execution, you can double click events to go to definition, however you cannot step back in code
But you can drag your little yellow arrow to another point in the code to re-execute some code, again this will not change what has already been executed
PostMan
2009-11-17 23:28:44
Yep, that's what I was doing, going backwards would have been ideal, but as Breckon suggests, it will be in 2010, which will be good!
Matt
2009-11-17 23:42:54
It will be the best feature added since debuggers have been around IMO.
PostMan
2009-11-18 00:29:14
+5
A:
VS2010 is supposed to be able to support historical debugging in which you can go backwards as you suggest. http://blogs.msdn.com/ianhu/archive/2009/05/13/historical-debugging-in-visual-studio-team-system-2010.aspx
Unfortunately there is no way to do this in VS2008.
Matt Breckon
2009-11-17 23:35:39