Windows 调试工具(WinDbg、KD、CDB、NTSD)Debugging Tools for Windows (WinDbg, KD, CDB, NTSD)

从这里开始大致了解 Windows 调试工具。Start here for an overview of Debugging Tools for Windows. 此工具集包括 WinDbg 和其他调试程序。This tool set includes WinDbg and other debuggers.

安装 Windows 调试工具Install Debugging Tools for Windows

可以将 Windows 调试工具作为开发工具包的一部分或作为独立的工具集进行获取:You can get Debugging Tools for Windows as part of a development kit or as a standalone tool set:

  • 作为 WDK 的一部分As part of the WDK

    Windows 调试工具包含在 Windows 驱动程序工具包 (WDK) 中。Debugging Tools for Windows is included in the Windows Driver Kit (WDK). 若要获取 WDK,请参阅下载 Windows 驱动程序工具包 (WDK)To get the WDK, see Download the Windows Driver Kit (WDK).

  • 作为 Windows SDK 的一部分As part of the Windows SDK

    Windows 调试工具包含在 Windows 软件开发工具包 (SDK) 中。Debugging Tools for Windows is included in the Windows Software Development Kit (SDK). 若要下载安装程序或 ISO 映像,请参阅 Windows 开发人员中心上的 Windows 10 SDKTo download the installer or an ISO image, see Windows 10 SDK on Windows Dev Center.

  • 作为独立工具集As a standalone tool set

    可以单独安装 Windows 调试工具而不安装 Windows SDK 或 WDK,方法是启动 Windows SDK 的安装,然后在要安装的功能列表中仅选择“Windows 调试工具”****(并清除所有其他功能的选择)。You can install the Debugging Tools for Windows alone, without the Windows SDK or WDK, by starting installation of the Windows SDK and then selecting only Debugging Tools for Windows in the list of features to install (and clearing the selection of all other features). 若要下载安装程序或 ISO 映像,请参阅 Windows 开发人员中心上的 Windows 10 SDKTo download the installer or an ISO image, see Windows 10 SDK on Windows Dev Center.

Windows 调试入门Get started with Windows Debugging

若要开始使用 Windows 调试,请参阅 Windows 调试入门To get started with Windows debugging, see Getting Started with Windows Debugging.

若要开始调试内核模式驱动程序,请参阅调试通用驱动程序 -“逐步操作”实验室(Echo 内核模式)To get started with debugging kernel-mode drivers, see Debug Universal Drivers - Step by Step Lab (Echo Kernel-Mode). 这是一个“逐步操作”实验室,演示了如何使用 WinDbg 调试 Echo(一个使用内核模式驱动程序框架 (KMDF) 的示例驱动程序)。This is a step-by-step lab that shows how to use WinDbg to debug Echo, a sample driver that uses the Kernel-Mode Driver Framework (KMDF).

调试环境Debugging environments

如果计算机安装了 Visual Studio 和 WDK,就会有六个可用的调试环境。If your computer has Visual Studio and the WDK installed, then you have six available debugging environments. 有关这些环境的说明,请参阅调试环境For descriptions of these environments, see Debugging Environments.

所有这些调试环境都提供适用于同一基础调试引擎(在 Windows 符号调试程序引擎 (Dbgeng.dll) 中实现)的用户界面。All of these debugging environments provide user interfaces for the same underlying debugging engine, which is implemented in the Windows Symbolic Debugger Engine (Dbgeng.dll). 该调试引擎也称为**“Windows 调试程序”,这六个调试环境统称为**“Windows 调试程序”。This debugging engine is also called the Windows debugger, and the six debugging environments are collectively called the Windows debuggers.

备注

** Visual Studio 包含自己的调试环境和调试引擎,它们统称为“Visual Studio 调试程序”。Visual Studio includes its own debugging environment and debugging engine, which together are called the Visual Studio debugger. 若要了解如何在 Visual Studio 中进行调试,请参阅在 Visual Studio 中调试For information on debugging in Visual Studio, see Debugging in Visual Studio. 对于调试托管代码(例如 C#)而言,使用 Visual Studio 调试程序通常是最容易的入门方法。For debugging managed code, such as C#, using the Visual Studio debugger is often the easiest way to get started.

Windows 调试程序Windows debuggers

Windows 调试程序可以在基于 x86、x64 或 ARM 的处理器上运行,并且可以调试在那些相同体系结构上运行的代码。The Windows debuggers can run on x86-based, x64-based, or ARM-based processors, and they can debug code that is running on those same architectures. 有时候,调试程序和要调试的代码运行在同一计算机上,但另外一些时候,调试程序和要调试的代码则运行在不同的计算机上。Sometimes the debugger and the code being debugged run on the same computer, but other times the debugger and the code being debugged run on separate computers. 不管哪一种情况,运行调试程序的计算机均称为“主计算机”,被调试的计算机均称为“目标计算机”In either case, the computer that is running the debugger is called the host computer, and the computer that is being debugged is called the target computer. 不管是主机计算机还是目标计算机,Windows 调试程序都支持以下 Windows 版本。The Windows debuggers support the following versions of Windows for both the host and target computers.

  • Windows 10 和 Windows Server 2016Windows 10 and Windows Server 2016
  • Windows 8.1 和 Windows Server 2012 R2Windows 8.1 and Windows Server 2012 R2
  • Windows 8 和 Windows Server 2012Windows 8 and Windows Server 2012
  • Windows 7 和 Windows Server 2008 R2Windows 7 and Windows Server 2008 R2

符号和符号文件Symbols and symbol files

符号文件存储了在运行可执行二进制文件时不需要的各种数据,但在调试代码时,符号文件非常有用。Symbol files store a variety of data that are not required when running the executable binaries, but symbol files are very useful when debugging code. 若要详细了解如何创建和使用符号文件,请参阅 Windows 调试符号(WinDbg、KD、CDB、NTSD)For more information about creating and using symbol files, see Symbols for Windows debugging (WinDbg, KD, CDB, NTSD).

蓝屏和崩溃转储文件Blue screens and crash dump files

如果 Windows 停止工作并显示一个蓝屏,则表示为防止数据丢失,计算机已突然关闭,并显示一个 Bug 检查代码。If Windows stops working and displays a blue screen, the computer has shut down abruptly to protect itself from data loss and displays a bug check code. 有关详细信息,请参阅 Bug 检查(蓝屏)For more information, see Bug Checks (Blue Screens). 可以使用 WinDbg 和其他 Windows 调试程序来分析 Windows 关闭时创建的故障转储文件。You analyze crash dump files that are created when Windows shuts down by using WinDbg and other Windows debuggers. 有关详细信息,请参阅使用 Windows 调试程序 (WinDbg) 进行故障转储分析For more information, see Crash dump analysis using the Windows debuggers (WinDbg).

工具和实用程序Tools and utilities

除了调试程序,Windows 调试工具还包括一系列适用于调试的工具。In addition to the debuggers, Debugging Tools for Windows includes a set of tools that are useful for debugging. 如需这些工具的完整列表,请参阅 Windows 调试工具中包含的工具For a full list of the tools, see Tools Included in Debugging Tools for Windows.

其他文档Additional documentation

如需与 Windows 调试工具相关的其他信息,请参阅调试资源For additional information related to Debugging Tools for Windows, see Debugging Resources. 若要了解 Windows 10 的新增功能,请参阅 Windows 调试工具:Windows 10 的新增功能For information on what's new in Windows 10, see Debugging Tools for Windows: New for Windows 10.