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

扶醉桌前 提交于 2019-12-18 10:25:12

问题


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#


回答1:


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




回答2:


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.




回答3:


Just you need to drag the little yellow arrow to any different point to re-execute the code you need.

Note: This will not change what has already been executed.




回答4:


Its too late but hope so it help for new comers. This is the Step-back while debugging with IntelliTrace




回答5:


The latest Visual Studio Preview (as of today: 2017-10-16) has "stepping back"

https://www.visualstudio.com/vs/preview/

"Improved debugging capabilities such as stepping back"



来源:https://stackoverflow.com/questions/1752591/in-visual-studio-is-there-a-way-to-step-back-to-see-what-the-few-lines-executed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!