Getting Started with Replay Debugging
Note: If you find errors/ambiguities in this article, please leave comments here (use the link at the end of this article). If you encounter any problems with VMware Workstation, please post your concerns or comments on the VMware replay debugging forum. Thanks!
Requirements
Please ensure that your hardware and software are supported.- Processor: P4, Core 2, Penryn (stepping B0+), Barcelona (stepping B3+)
- Host OS: 32/64-bit Windows XP SP2, Windows Server 2003, Vista (Recommended: 32-bit Windows XP SP2)
- Guest OS: 32-bit Windows XP, Windows Server 2003, Vista (Recommended: Windows XP SP2)
- Debugger: Visual Studio 2005 SP1 or Visual Studio 2008 (Recommended: Visual Studio 2005)
- VMware Workstation: Recent version of Workstation 6.5 (release candidate 2 or newer)
Installation
Please ensure that the necessary software is installed.- Visual Studio: Ensure that you have installed Visual Studio before installing the latest version of VMware Workstation. This is necessary to ensure that the Workstation installation process installs the Visual Studio plugin.
- VMware Workstation 6.5: Ensure that you install Workstation after Visual Studio. Install Workstation 6.5 (release candidate 1 is available here for beta program members (free signup)). When it is released, Workstation 6.5 will be a free upgrade for all Workstation 6.0 license holders.
- Guest operating system: Ensure that a supported version of Windows (above) is installed in the virtual machine you intend to use for debugging. This virtual machine can only have one virtual processor. You find that performance is better if the virtual machine has a relatively small amount of memory (say 256MB) and if background snapshots are disabled (Edit > Preferences > Priority tab).
- Guest tools: Ensure that the latest version of guest tools are installed in the Windows virtual machine. This is essential. Replay debugging will not work without the latest tools.
Power On Your Virtual Machine
Ensure that the virtual machine is working, and don't forget to install the latest guest tools! This is a good time to create a snapshot (let's call it "InitialState"). We'll use this as the starting point for the recordings we create.Create a Visual Studio Project
Start Visual Studio. You should see a VMware menu. If you do not, this indicates that VMware Workstation was not properly installed (did you ensure that Workstation was installed after Visual Studio was installed?).Create a Visual Studio project as follows.
- File > New > Projects...
- Project type: Visual C++ (Win32)
- Visual Studio installed templates: Win32 Project
- Name: HiMom
- In Win32 Application Wizard, set application type to Console application
- Project > HiMom Properties
- Configuration Properties > C/C++ > Code Generation: change runtime library to "Multi-threaded Debug (/MTd)"
Now edit your program in HiMom.cpp (make your mother proud!), save it, compile it (Build > Build Solution), and run it (Debug > Start Debugging). Okay, that's nice, but it doesn't look like replay debugging. It isn't. Be patient! We need to configure the VMware Options first.
Configure VMware Options in Visual Studio
You need to tell Visual Studio what virtual machine you would like to use for debugging.- Visual Studio: VMware > Options...
- Configuration Properties > Replay Debugging in VM > General: Make sure you are changing the replay debugging properties (the remote debugging properties will have no effect for us). Set the "Virtual Machine" field to the full path of the .vmx file of the virtual machine you would like to use to debug (note that you can browse the filesystem to find this file). The "Recording to Replay" field specifies the recording you would like to use for debugging, but as you haven't created a recording yet, you can ignore this.
- Configuration Properties > Replay Debugging in VM > Advanced: Set the Base Snapshot for Recording field to the name of the snapshot you created, above ("InitialState"). Just before creating a recording, this snapshot will be restored. If no snapshot is specified, the virtual machine has to be powered on (and we don't want to wait for that!).
Create a Recording
Before we can debug a recording, we need to create a recording. Makes sense. We can do this via the VMware menu (VMware > Create Recording for Replay). This will start up Workstation, ask for your guest login credentials, restore the "InitialState" snapshot, share the program to debug (HiMom.exe) with the virtual machine, start a recording, run the program, and stop the recording. Note that this step automatically populates the "Recording to Replay" field in the General options with the name of the recording you just created (it'll have a boring name like "Recording 1").Troubleshooting: If your program never starts, this may be because the program can't run in the VM (e.g., because it's missing a needed DLL). The best way to diagnose these problems is to copy the program to debug into the VM (drag and drop works well) and run it manually. This usually provides sufficient diagnostic information to figure out what the problem is.
Start Debugging
Now that you've created a recording in which the program is running, let's debug it. Set a breakpoint on the first line of main and select VMware > Start Replay Debugging. The recording will start replaying and you'll hit the breakpoint. You should be able to examine local variables, single step, set other breakpoints, and do (almost) all the usual debugging activities.The important difference with regular debugging is that here you are debugging a recording of the program, so you cannot change the behavior of the program as you debug it. This means you can't change the value of variables/registers nor can you execute code that was not executed in the recording. In addition, you will notice that input to the program (network, keyboard, etc.) need not be provided during replay debugging, because the input provided while the recording was created is reused during replay.
Reverse Execution
Please try out the reverse execution feature (VMware > Reverse Continue). This feature simulates reverse execution by replaying from an earlier point in time. This is particularly useful for tracking down memory corruption problems. When you encountered a corrupted data value, place a data breakpoint on this data value and execute backward to find out where it was corrupted! In a subsequent article I'll discuss methods for improving the performance of reverse execution.An Alternate Method for Creating a Recording
Recordings can be created via Visual Studio (see above), but they can also be created using the Workstation UI. You simply copy the program you would like to debug to the VM (or place it in a shared file system), start recording, start the program, and stop recording. That's it. Naturally, you'll have to configure Visual Studio (via the VMware > Options... menu) to use the recording you have created.Labels: instruction
21 Comments:
Hi:
I would like to use WinDBG to debug the Windows kernel. When will it be available?
Thanks.
By Wang, At October 7, 2008 at 1:57 PM
Hi, Wang. Sorry, we don't have a timeline for when WinDBG support will come along. I will say that this is a commonly requested extension. Thanks. E.
By RS, At October 9, 2008 at 8:50 AM
Hi, Lewis:
I would like to use "Live Debugging".
Could you demo simply how to build up it on Video?
Thanks a lot!!
By Unknown, At April 15, 2010 at 11:41 PM
Hi, Andy. Sorry, I don't have a demo video for live debugging. I'd recommend the manual (covering both live and replay debugging)...
http://www.vmware.com/pdf/ws7_visualstudio_debug.pdf
And if you're an eclipse user (versus Visual Studio), here's another useful document:
http://www.vmware.com/pdf/ws7_eclipse_debug.pdf
Best of success to you. E.
By RS, At April 19, 2010 at 8:37 AM
Thank you a lot for providing individuals with a very spectacular possibility to read critical reviews from this site.
SAS Training in Bangalore
By UNKNOWN, At October 16, 2017 at 5:23 AM
You need to get involved in a contest for one of the most useful blogs on the web. I’m going to recommend this web site! stiply.nl elektronische handtekening
By mtom, At July 20, 2018 at 12:31 AM
This is getting a bit more subjective, but I much prefer the Zune Marketplace. The interface is colorful, has more flair, and some cool features like ‘Mixview’ that let you quickly see related albums, songs, or other users related to what you’re listening to. Clicking on one of those will center on that item, and another set of “neighbors” will come into view, allowing you to navigate around exploring by similar artists, songs, or users. Speaking of users, the Zune “Social” is also great fun, letting you find others with shared tastes and becoming friends with them. You then can listen to a playlist created based on an amalgamation of what all your friends are listening to, which is also enjoyable. Those concerned with privacy will be relieved to know you can prevent the public from seeing your personal listening habits if you so choose. sd wan technology
By mtom, At August 6, 2018 at 2:26 AM
hello, u can have bonus if u want play football with agen bola terpercaya.
By Jasa Seo Terbaik, At August 21, 2018 at 1:00 AM
Guys kalo kalian lagi cari agen bola terpercaya cobain deh main di Scorebet88 di jamin dah ga bakal nyesel..
By Unknown, At August 29, 2018 at 10:40 AM
wow.
https://www.blogger.com/comment.g?blogID=3384227244253786878&postID=3846315374948273501&page=1&token=1539711780409
By eleanor ekevin, At October 16, 2018 at 10:44 AM
I simply just couldnt leave your website just before saying that I really enjoyed the good quality information you offer to your visitors… Definitely will be back often to check on up on brand new stuff you post! https://www.btcsoftware.co.uk/making-tax-digital/
By Timy Tons, At October 23, 2018 at 12:05 AM
I found a lot of interesting information here. A really good post man, very thankful and hopeful that you will write many more posts like this one.
ivanka trump hot pics
By mohit, At November 13, 2018 at 4:52 AM
Torrentsformac
A free download hub to activate, crack your softwares for windows and you mac. you can download keygen, generator and activators to crack your desired Blue Iris Crack With License Key
By Unknown, At November 26, 2018 at 10:24 PM
Appyzone
You can get free mac & pc applications. You are one click away from getting best cracks, cheats, and patches of games CorelDRAW X8 Crack With Keygen
By Unknown, At November 26, 2018 at 10:27 PM
TreasureBox is operated by a group of young, passionate, and ambitious people that are working diligently towards the same goal - make your every dollar count, as we believe you deserve something better.
Check out the best
headboard nz
laptop table nz
laptop table
By Aditi Ray, At June 21, 2019 at 10:19 AM
lifestyle whatsapp groups
By Raj Maan, At July 9, 2019 at 10:43 AM
gta 5 app
By luckys, At July 13, 2019 at 9:17 AM
fb name stylish
fb stylish name
stylish names on fb
facebook stylish name
stylish names for facebook
stylish names for fb
free netflix account
netflix accounts free
netflix premium account
netflix cookies
Netflix mod
Netflix mod apk
By Devender Gupta, At August 11, 2019 at 8:57 AM
funny WiFi names
cool WiFi names
claver WiFi names
cool and claver WiFi names
funny WiFi names list
Good wifi names
wifi names 2020
Disney wifi names
wifi name for gamers
bollywood movies funny WiFi names
By Devender Gupta, At August 23, 2019 at 12:53 AM
I think this is an informative post and it is very useful and knowledgeable. therefore. I would like to thank you for the efforts you have made in writing this article.
www.caramembuatwebsiteku.com/tips-tentang-struktur-website
By Rhianne Jhane, At August 31, 2019 at 1:01 AM
https://trickcity.hatenablog.com/
By Ashish, At September 9, 2019 at 7:19 PM
Post a Comment
Subscribe to Post Comments [Atom]
<< Home