I have an error which is occurring only very late in my code (after it's been running for ~20 minutes) and so trying to pinpoint exactly where it is is tricky because I have a lot of recursive function calls and if I go too far the important variable values may have been changed. Is there a way I can set a kind of save point where all the variables have their values saved and which I can jump back to after I've done some exploring rather than having the run the whole thing again from the beginning?
-
question is not explanatory please elaborate it more for clear understanding and post some code also.and you are not using breakpoints for this?Rajput– Rajput2016-10-25 12:48:51 +00:00Commented Oct 25, 2016 at 12:48
-
I really don't think posting the code will help, this is a question about debugging in general. A breakpoint will stop the execution of the code, but if I then carry on stepping forward values of variables will be changed and if I go back to the breakpoint they will not have the same values as they did initially. I was asking whether you could create a point that you can jump back to that has all the same variable values as when it was created.Henry– Henry2016-10-25 12:53:15 +00:00Commented Oct 25, 2016 at 12:53
-
Really there is no way of doing this.Is there any problem with data issue which is throwing error and you need to find on which instance this is happening?Rajput– Rajput2016-10-25 12:58:50 +00:00Commented Oct 25, 2016 at 12:58
-
1Would historical debugging help? msdn.microsoft.com/en-us/library/mt228143.aspxRoger Lipscombe– Roger Lipscombe2016-10-26 11:31:08 +00:00Commented Oct 26, 2016 at 11:31
-
@RogerLipscombe that sounds like exactly the thing I want, unfortunately I don't have Visual Studio Enterprise edition :(Henry– Henry2016-10-26 13:26:32 +00:00Commented Oct 26, 2016 at 13:26
2 Answers
I found this and just wanted to point out that Roger Lipscombe's comment is what I was also looking for: Precisely: IntelliTrace https://learn.microsoft.com/en-us/visualstudio/debugger/intellitrace?view=vs-2022
and
Historical Debugging (which is part of IntelliTrace) https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2015/debugger/historical-debugging?view=vs-2015&redirectedfrom=MSDN
Only available on the enterprise version of Visual Studio
Comments
I have a workaround for this kind of issue: Using the Data Breakpoint, at least, it could output and save the value manually, and it also can help you check that what value was applied to your code line, I just get this idea from this case I met before:
If IntelliTrace tool is helpful for you like Roger Lipscombe's suggestion, one idea is that you could use IntelliTrace Standalone Collector tool without the VS in one machine: