如何在 Visual Studio 2013 中使用带/不带Microsoft应用程序验证程序的调试

How to use Debug with/without Microsoft Application Verifier in Visual Studio 2013

本文关键字:Microsoft 不带 应用 程序验证 调试 程序 Visual Studio 2013      更新时间:2023-10-16

所以我安装了应用程序验证器来帮助我进行调试,但是我不知道如何正确使用它。

首先,它似乎已经永久地依附于Visual Studio。每当我通过 Visual Studio 在调试模式下运行任何应用程序时,验证程序都会自动介入。这是一个问题,因为它会大大减慢执行速度,但似乎没有办法在没有验证器的情况下运行调试器了?我真的不想每次想使用它时都重新安装它,然后再次卸载它。

其次,它似乎确实可以有效地发现泄漏等,但我不确定如何处理输出消息:

=======================================
VERIFIER STOP 00000900: pid 0x43C: A heap allocation was leaked. 
    12626FE8 : Address of the leaked allocation. Run !heap -p -a <address> to get additional information about the allocation.
    04E2BA6C : Address to the allocation stack trace. Run dps <address> to view the allocation stack.
    11E0AFE0 : Address of the owner dll name. Run du <address> to read the dll name.
    6C660000 : Base of the owner dll. Run .reload <dll_name> = <address> to reload the owner dll. Use 'lm' to get more information about the loaded and unloaded modules.

=======================================

在哪里可以运行列出的命令?没有单独的控制台,直接启动验证程序会启动 GUI,但您也不能在其中输入任何命令。

我正在使用Windows 8.1和Visual Studio ultimate 2013。该项目是一个C++项目。

//编辑:

关于第一个问题:我只需要从 GUI 的列表中删除可执行文件,我认为如果程序没有运行,这不会有任何影响。

您可以在WinDBG中运行这些命令,您可以在此处获得这些命令

使用WDK(本质上是WinDBG(的调试器进行调试时,还可以在Visual Studio的即时窗口中运行这些命令。

回答如何在Visual Studio中附加应用验证程序的附带问题:

  1. 运行应用程序验证程序 GUI
  2. 选择要调试的二进制文件(exe/dll(
  3. 选择要检查的选项
  4. 单击[保存] - 它会自动跟踪,直到您明确删除应用程序。这些设置即使在系统重新启动时也能继续存在。