How to reset all procedures, bring up and start debugging?

I have an application that has been running for a long time and then it crashes. I need to debug it several times to fix the error, and I don't want to wait for an hour every time to reach the state where the error occurred.

So, I want some tool to clone the whole process on disk, then bring it up, attach to it and debug.

I am using Visual Studio 2012/2013 on (surprise) Windows.

For example:

for (int i = 0; i < 10000; ++i)
{
    if (i == 9999)
        throw MyExcept();
}

      

And I want to have the saved state of the application (process) at the 9998th iteration so I can start debugging from there.

UPD 1: Visual Studio dump files are not great because I can't get all the debugger functionality after VS open it. For example: I can't set breakpoints and even the old ones don't work.

UPD 2: Also I need the ability to duplicate this application save session.

+3


source to share


2 answers


If I understand correctly, you want to accomplish two tasks:

1) Break execution in a specific state

You need to set a conditional watchpoint to achieve this, or a data breakpoint in Visual Studio terms. Have a look at this question: Can I set a breakpoint when a variable gets a certain value in .NET?



2) Dump the main file

Once you've set a watchpoint and your program has reached that point, you can reset the kernel file. From this you can continue execution later. There is an official entry on the official FAQ entry on how to dump and boot kernels.

0


source


You need procdump from here

  • Register yourself as a Just-in-Time Debugger (AeDebug).
  • Perhaps you should enable full local dumps .
  • Program crash
  • Start process with procdump from full dump


But I think it's better to use the DebugBreak API in your example without crashing. Usually an accident will not allow you to start further - only post-match analysis.

0


source







All Articles