Is there a way to step back through a program from the point where an error/Exception has occurred? Or look at the sequence in which the methods were called before the error occurred?
These icons navigate the events in the Events Tab. So, if you've just taken a step in live debugging (F10 or F11), you can use the Step Backward button to quickly navigate to the previous step. This will automatically put Visual Studio in Historical debugging mode, at the line of code you've stepped back to.
To turn off stop on exceptions press " Ctrl + Alt + E ". This will open the Exceptions window . Untick "Common Language Runtime Exceptions - Thrown". That would prevent it from pausing from within the delegate, but not when it's rethrown on Wait .
Tell the debugger to break when an exception is thrownIn the Exception Settings window (Debug > Windows > Exception Settings), expand the node for a category of exceptions, such as Common Language Runtime Exceptions. Then select the check box for a specific exception within that category, such as System.
To set a breakpoint in source code: Click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.
In the Ultimate versions of Visual Studio 2010 you can use Inellitrace to go back in the execution, as Dan Puzey mentioned.
However, in any version of Visual Studio you can still get a lot of information just from the call stack. It doesn't only show the calls that lead up to the current position, by double clicking on points in the Call Stack window you can jump to the point in the code where each method was called. The state of the stack is preserved, so you can even still see the values of local variables in the calling method.
If you have VS2010 Ultimate, the "Intellitrace" functionality allows you to do exactly that. It basically logs a huge amount of execution data (up to and including every method call & parameter made) and allows you to step back in time to examine variable values at those points.
You will see the trace in the Stack Trace (Call Stack Window in Visual Studio).
If you are using debugger you can drag and drop the yellow arrow to the previous lines of code to repeat the scenario. However, it does not always work.
Right click on the line of code to which you want to get back and select "Set next statement" Another option is to drag the yellow arrow to the desired line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With