Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In visual studio, is there a way to step back to see what the few lines executed before were?

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#

like image 873
Matt Avatar asked Nov 17 '09 23:11

Matt


People also ask

Can you step back in Visual Studio?

The recent updates of Visual Studio 2017 (version 15.5 Preview) comprise with several sets of new features and improvements. Once of such great enhancement is “step-back” while debugging. Now, you can perform a step-backward and forward while debugging your code with IntelliTrace Debugging.

How do I view execution steps in Visual Studio?

Press Shift + F11 (or Debug > Step Out). This command resumes app execution (and advances the debugger) until the current function returns.

How do I step back in Visual Studio code?

You can do step-back to previous line in VS code via the use of new Step Backward icon while debugging your code with IntelliTrace Debugging. Now you can go previous line while debugging with the help of step backward icon.

How do I go back while debugging?

Open Debug Configuration -> Debugger -> Enable Reverse Debugging at startup . Than you can press shift+F5 or shift+F6 for step back like F5 or F6 for step forward.


1 Answers

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

like image 84
PostMan Avatar answered Sep 24 '22 04:09

PostMan