Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to save state of Visual Studio C++ debugging session?

I am using Visual Studio C++ 2013. I am running a number cruncher program so it proceeds linearly/predictably. However I have a test which takes several hours to run, before asserting due to logic error in my code. I can get a breakpoint before the crash, but I can't step backwards without starting all over again.

Is there any way to get Visual Studio to save the state of my program, so that I can restart at that point again?

The program state is very complicated and it would take a lot of work for me to save all the state to files myself for resuming later.

like image 565
Neil Kirk Avatar asked Jul 28 '14 09:07

Neil Kirk


2 Answers

You may consider virtual computers. You can make their snapshots and save them. This may be an overkill, but is guaranteed to work.

like image 57
Jakub Avatar answered Nov 13 '22 16:11

Jakub


When debugging in Visual Studio (even from a breakpoint) use Debug|Save Dump As... to save the current debugging state. When saving, make sure you select "Minidump With Heap" so you have access to heap memory.

Later you can double click the .dmp file to open it with Visual Studio right where you were.

like image 7
Robert Basler Avatar answered Nov 13 '22 16:11

Robert Basler