Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I found a solution: "replay debugging" using VMware Workstation and Visual Studio 2010. Setting it up takes a lot of time, but you are rewarded with a Visual Studio C++ debugger that can debug backwards in time. Here is a video that demonstrates how replay debugging works: <a href="http://blogs.vmware.com/workstation/2010/01/replay-debugging-try-it-today.html" rel="nofollow">http://blogs.vmware.com/workstation/2010/01/replay-debugging-try-it-today.html</a>.</p> <p>A drawback of the solution is that VMware seemingly has discontinued replay debugging in the latest VMware versions. Furthermore, only certain processor types seem to support replaying. I have not found any comprehensive list of supported processors; I tested the replay features on three of my PCs: replaying did not work on a Core i7 200; replaying worked on a Core2 6700 and on a Core2 Q9650.</p> <p>I really hope that VMware reconsiders and introduces replay debugging again in future VMware Workstation versions, because this really adds a new dimension to debugging.</p> <p>For those of you who are interested, here is a description how you can set up an environment for replay debugging:</p> <p>In the description below, "local debugging" means that Visual Studio and VMware are installed on the same PC. "Remote debugging" means that Visual Studio and VMware are installed on different PCs.</p> <ul> <li><p>Install Visual Studio 2010 with SP1 on the host system.</p></li> <li><p>Make sure Visual Studio has been configured to use Microsoft's symbol servers. (Under "Tools | Options | Debugging | Symbols"). </p></li> <li><p>On the host system, install "Debugging Tools for Windows".</p></li> <li><p>Install VMware Workstation 7.1. (Version 8.0 no longer contains the replay debugging feature). This will also install a plug-in into Visual Studio.</p></li> <li><p>Install a virtual machine (VM) on VMware with Windows XP SP3.</p></li> <li><p>If the application under test is a debug build, install the Visual Studio debug DLLs on the VM. (See <a href="http://msdn.microsoft.com/en-us/library/dd293568.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/dd293568.aspx</a> for instructions how to do that, but use a "Debug" configuration instead of "Release").</p></li> <li><p>Copy "gflags.exe" from the host's "Debugging Tools for Windows" directory to the VM, run gflags.exe on the VM, select "Disable paging of kernel stacks" under the "System Registry tab" and press OK. Reboot the VM.</p></li> <li><p>Copy all EXE and DLL files of the application under test to the VM and make sure that you can start the application and reproduce the problem.</p></li> <li><p>Shutdown the VM and create a snapshot (via context menu item "Take Snapshot" in VMware Workstation).</p></li> <li><p>(Only for remote debugging:) Start the following command on the Visual Studio PC and enter an arbitrary passcode:</p> <p>C:\Program Files\VMware\VMware Workstation\Visual Studio Integrated Debugger\dclProxy.exe <em>hostname</em></p> <p>Replace <em>hostname</em> by the name of the PC.</p></li> <li><p>(Only for remote debugging:) Create a recording manually for the VM. I.e. log in to the VM's operating system, start the recording (via context menu "Record"), run the application under test and perform the actions necessary to reproduce the problem. Then stop and save the recording.</p></li> <li><p>Start Visual Studio and go to "VMware | Options | Replay Debugging in VM | General", and set the following values:</p> <ul> <li>"Local or Remote" must be set to "Local" for local debugging or to "Remote" for remote debugging.</li> <li>"Virtual Machine" must be set to the path to the VM's .vmx file .</li> <li>"Remote Machione Passcode" must be set to be passcode you used above (only for remote debugging).</li> <li>"Recording to Replay" must be set to a recording name that you previously created with VMware.</li> <li>"Host Executable Search Path" must be set to a directory in which you save DLLs which are required by the application under test and which are needed by Visual Studio to display correct stack traces.</li> </ul> <p>Press "Apply".</p></li> <li><p>Go to "VMware | Options | Replay Debugging in VM | Pre-Record Event", and set the following values:</p> <ul> <li>"Base Snapshot for Recording": name of snapshot created previously.</li> </ul> <p>Press "OK".</p></li> <li><p>(For local debugging:) In Visual Studio, select "VMware | Create Recording for Replay"; this restarts the VM. Login to the VM, run the application under test and perform the actions necessary to reproduce the problem. Then stop and save the recording.</p></li> <li><p>Select "VMware | Start Replay Debugging". VMware now automatically restarts the VM and the application under test and replays the recorded actions. Wait until the application crashes; the Visual Studio debugger then automatically becomes active.</p></li> <li><p>In the Visual Studio debugger, set a breakpoint to a location where you think the application has been before the crash. Then, select "VMware | Reverse Continue". The debugger now runs <strong>backwards</strong> to the breakpoint. This operation can take some time because the VM will be restarted and replayed until your breakpoint is reached. (You can speed up this operation by adding a snapshot a few seconds before the crash happens when you record the scenario. You can add additional snapshots during replay debugging.)</p></li> <li><p>Once VMware has replayed the VM to your breakpoint, you can use "Step Over" and "Step Into" to step forward from your breakpoint, i.e. you replay the recorded history of events, until you reach a point where you can identify the reason why your application crashed.</p></li> </ul> <p>Further information: <a href="http://www.replaydebugging.com/" rel="nofollow">http://www.replaydebugging.com/</a> </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload