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

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.

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.

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

Related

Visual Studio 2010 stops implementing changes to executables

I believe there is a glitch in Visual Studio 2010 which has haunted me for several years, across numerous different computers irrespective of the Windows version. It happens in both the express and ultimate editions. I have tried restarting my computer, instead of using shutdown, which did not help.
After coding for a period of time, I will make a change to my C code, for example changing something or perhaps adding a message box. However, this change does not appear in the executable, and I often make numerous changes before I realise this glitch has happened.
I have made a habit of clicking save all, save, Clean Solution, and then Build. There are no errors, warnings, and I can check the executable was not in the release folder before compilation.
I routinely lose hours of progress from this bug, as I am mislead into thinking my bug fixes are incorrect, when in actual fact Visual Studio has decided to ignore my changes. It appears to occur when I am rapidly recompiling my executable because I am only making small changes, such as changing strings, and I need then execute the binary to check the changes.

Is it possible to edit code while running in Visual Studio 2017, even with 'Edit and Continue' enabled?

Frequently I want to change code when the project is running, but am disallowed from doing this because Edit and Continue is enabled.
I assume this is some kind of protective measure, because the changes I make won't apply to the current execution, but I am fine with that. I would like to make them, and then click 'apply' somewhere to make the build update. Is this possible? (It used to be in previous versions of Visual Studio)
Opening a second instance of Visual Studio, and opening the code file there will allow this to be done.

Visual Studio Memory Profiling and Breakpoints?

I am using the Memory Usage analysis tool from the Performance and Diagnostics tool (Alt + F2) in Visual Studio Ultimate 2013 Update 4. My project is written using unmanaged C++.
During a memory profiling session, I am really hoping to have Visual Studio trigger several breakpoints which I have set. These breakpoints are triggered just fine whenever I run the program without the profiler, but under the exact same conditions during profiling, they are not triggered.
Is there a way to run the memory profiler with breakpoints?
Note: I know I could use application lifecycle marks or user marks to have them show up in the profiler graph. However, the breakpoints will be far more helpful to root out an issue by stepping through the code whenever I see a change in the memory usage.

cannot find .exe file in Visual C++ Express 2010

So, I installed Visual C++ 2010 for the fifth time, I believe, and every time I debug a program, even the simplest c++ program fails to compile, and I get the following error:
Unable to start program 'C:\Users\Ruth\sid\game\Debug\game.exe'.
The system cannot find the file specified.
I don't know why this is happening or if I need to create an exe file. myself. I need help fast. Thanks.
Do the setup program of Visual C++ 2010 includes a repair program? If it does, then run it and try to repair your MSVC by clicking the "Repair" button therein and following the next procedure, but it takes time to complete.

Why won't my C++/Win32 project work outside of Visual Studio?

I have a rather large project I'm working on in C++/Win32, and now that I'm nearing completion, I wanted to start testing it on other machines. My project works great in Visual Studio - either in Debug or Release mode. However, if I try to run either executable from its build directory (with all of the supporting files in place) they crash. I tried using the debug feature provided by visual studio, and it opened malloc.c, saying that a heap has been corrupted. If I had a memory leak or something somewhere, why wouldn't I be getting this error when I run my project from Visual Studio? I could use some pointers on how to debug what the problem might be.
I don't think that is due to memory leak. It has happened to me too when I tried to copy only the compiled executable but not depend libraries. So just check whether all depend libraries are available in other systems too.