Saving and debugging from an image in Visual Studio

1k views Asked by At

I'm coding a complicated algorithm in C++ in Visual Studio 2017, and I would like to know if it is possible to save an image of the complete state after the debugger has stopped in an interruption point, and then return to it at will as if I had run the code from the beginning.

The reason is that it takes a lot to do the initialization up to that point.

1

There are 1 answers

2
Leo Liu On

Saving and debugging from an image in Visual Studio

You can try to use Dump files to save current debugging state. When saving, make sure you select "Minidump With Heap" so you have access to heap memory. Although you can't continue execution, you can examine the stacks, threads, and variable values of the app at the time of the dump.

How to:

To save a dump file:

While stopped at an error or breakpoint during debugging, select Debug

Save Dump As.

In the Save Dump As dialog box, under Save as type, select Minidump or Minidump with Heap (the default).

Browse to a path and select a name for the dump file, and then select Save.

Please check this document Dump files in the Visual Studio debugger.

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

Hope this helps.