Debugging Tools for Windows is a set of extensible tools for
debugging device drivers for the Microsoft Windows family of operating
systems. These tools are intended for use by driver developers and
hardware partners. Debugging Tools for Windows supports debugging of:
• | Applications,
services, drivers, and the Windows kernel. |
• | Native
32-bit x86, native Intel Itanium, and native x64 platforms. |
• | Microsoft
Windows NT 4.0, Windows 2000, Windows XP, Microsoft Windows Server
2003, Windows Vista and Windows Server 2008. |
• | User-mode
programs and kernel-mode programs. |
• | Live
targets and dump files. |
• | Local and remote targets. |
In
addition to Debugging Tools for Windows, effective debugging also
requires:
• | Special
debugging routines, macros, and global variables in the Windows
Driver Kit (WDK). You can use these routines in your driver code to
send messages to a debugger and set breakpoints to aid in debugging. |
• | Access to
Windows symbol files. If you have access to the Internet while
debugging, you can set your debugger's symbol path to point to the
Windows symbol server. If you do not have access to the Internet while
debugging, you can download symbols in advance from the Microsoft
website. |
Debugging Tools for Windows
includes WinDbg, a powerful debugger with a graphical interface and a
console interface, as well as the console-based debuggers NTSD, CDB, and
KD.
About WinDbg
WinDbg provides source-level debugging through a graphical user
interface and a text-based interface.
• | WinDbg uses the Microsoft
Visual Studio debug symbol formats for source-level debugging. It can
access any public function's names and variables exposed by modules that
were compiled with Codeview (.pdb) symbol files. |
• | WinDbg can
view source code, set breakpoints, view variables (including C++
objects), stack traces, and memory. It includes a command window to
issue a wide variety of commands not available through the drop-down
menus. For kernel-mode debugging, WinDbg typically requires two
computers (the host machine and the target machine). It also allows you
to remotely debug user-mode code. |
To
Prepare for a Debugging Session
1. | If
you want to debug kernel-mode code, set up a host computer to run the
debugger and a target computer to run the code being debugged. Connect
the two computers using either an IEEE 1394 cable or a null-modem cable
between two serial ports. |
2. | Download
and install the latest version of Debugging Tools for Windows on the
host computer.
The tools can also be installed from the Windows DDK, the Platform SDK,
or the Customer Support Diagnostics CD. |
3. | Use
Windows Symbol Server to access the symbol files from the host
computer. |
About the Microsoft Symbol
Server
Symbol server technology is built into Debugging Tools
for Windows. Microsoft provides access to an Internet symbol server that
contains symbol files for the Microsoft Windows Server 2003, Windows
XP, and Windows 2000 operating systems, as well as other Microsoft
products.
The Internet symbol server is populated with a variety
of Windows symbols for Microsoft Windows operating systems, including
hot fixes, Service Packs, Security Rollup Packages, and retail releases.
Symbols are also available on the server for current Betas and Release
Candidates for Windows products, plus a variety of other Microsoft
products, such as Microsoft Internet Explorer.
If you have access
to the Internet during debugging, you can configure the debugger to
download symbols as needed during a debugging session, rather than
downloading symbol files separately before a debugging session. The
symbols are downloaded to a directory location that you specify and then
the debugger loads them from there.
To use the Microsoft
Symbol Server
1. | Make
sure you have installed the latest version of Debugging Tools for
Windows. |
2. | Start a debugging
session. |
3. | Decide where to store
the downloaded symbols (the "downstream store"). This can be a local
drive or a UNC path. |
4. | Set
the debugger symbol path as follows, substituting your downstream store
path for DownstreamStore. SRV*DownstreamStore*http://msdl.microsoft.com/download/symbols |
For
example, to download symbols to c:\websymbols, you would add the
following to your symbol path:
SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols
Note:
http://msdl.microsoft.com/download/symbols is not browsable and is
intended only for access by the debugger. For more information on
setting symbol paths and using symbol servers, see the documentation
accompanying Debugging Tools for Windows.