09.02.2014 Views

Windows sysinternals

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 7 Process and Diagnostic Utilities 251<br />

By default, LiveKd takes a snapshot of the local computer and runs Kd.exe. The –w and –k<br />

options let you specify WinDbg.exe or any other debugger instead of Kd.exe. LiveKd passes<br />

any additional command-line options that you specify on to the debugger, followed by –z<br />

and the path to the simulated dump file.<br />

To debug a Hyper-V virtual machine from the host, specify –hv and either the friendly name<br />

or the GUID of the VM. To list the names and GUIDs of the available VMs, run LiveKd with the<br />

–hvl option. Note that you can debug only one VM on a host at a time.<br />

With the –o option, LiveKd just saves a kernel dump of the target system to the specified<br />

dumpfile and doesn’t launch a debugger. This option is useful for capturing system dumps<br />

for offline analysis. If the target is a Hyper-V VM, you can also add –p to the command line<br />

to pause the VM while the snapshot is being captured in order to get a completely consistent<br />

snapshot.<br />

If you are launching a debugger and don’t specify –k and a path to a debugger, LiveKd will<br />

find Kd.exe or WinDbg.exe if it is in one of the following locations:<br />

■ The current directory when you start LiveKd<br />

■ The same directory as LiveKd<br />

■ The default installation path for the Debugging Tools (“%ProgramFiles%\Debugging<br />

Tools for <strong>Windows</strong> (x86)” on x86 or “%ProgramFiles%\Debugging Tools for <strong>Windows</strong><br />

(x64)” on x64)<br />

■ A directory specified in the PATH variable<br />

If the _NT_SYMBOL_PATH environment variable has not been configured, LiveKd will ask if<br />

you want it to configure the system to use Microsoft’s symbol server, and then it will ask for<br />

the local folder in which to download symbol files (C:\Symbols by default).<br />

Refer to the Debugging Tools documentation regarding how to use the kernel debuggers.<br />

Note The debugger will complain that it can’t find symbols for LiveKdD.SYS. This is expected<br />

because I have not made symbols for LiveKdD.SYS available. The lack of these symbols does not<br />

affect the behavior of the debugger.<br />

LiveKd Examples<br />

This command line debugs a snapshot of the local computer, passing parameters to WinDbg<br />

to write a log file and not to display the Save Workspace? dialog box:<br />

livekd -w -Q -logo C:\dbg.txt<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!