5

我知道如何手动使用 AppVerif 和 windbg 来调试进程问题,但我正在组合一个自动化系统来运行一系列压力测试,而无需用户在场。

我需要一种方法来在 AppVerif 发现问题时生成进程转储,然后继续(假设它是一个非致命错误)。

有没有办法将 AppVerif 正确配置为只生成进程的转储而不是闯入,或者我是否必须附加 windbg 并以某种方式自动化它以在遇到中断时创建转储,然后继续。

4

1 回答 1

2

不,这不是 appverif.exe 的内置功能。不是真正的问题,您可以使用另一个程序来生成 minidump。像SysInternals 的 ProcDump 实用程序

运行 appverif.exe 以配置您的测试应用程序。您想要更改 ExceptionOnStop 属性(底部窗口)。将其设置为 TRUE,以便在测试失败时引发异常。

然后使用 procdump 运行您的测试,告诉它使用参数在未处理的异常上生成转储-e。例如:

  c:\bin\procdump -e -x . broken.exe

当我在 broken.exe 上尝试时看起来像这样,它故意破坏了一个句柄:

ProcDump v7.1 - Writes process dump files
Copyright (C) 2009-2014 Mark Russinovich
Sysinternals - www.sysinternals.com
With contributions from Andrew Richards

Process:               broken.exe (5892)
CPU threshold:         n/a
Performance counter:   n/a
Commit threshold:      n/a
Threshold seconds:     10
Hung window check:     Disabled
Log debug strings:     Disabled
Exception monitor:     Unhandled
Exception filter:      *
Terminate monitor:     Disabled
Cloning type:          Disabled
Concurrent limit:      n/a
Avoid outage:          n/a
Number of dumps:       1
Dump folder:           .\
Dump filename/mask:    PROCESSNAME_YYMMDD_HHMMSS


Press Ctrl-C to end monitoring without terminating the process.

[11:23:30] Exception: C0000008.INVALID_HANDLE
[11:23:30] Exception: C0000421
[11:23:30] Unhandled: C0000421
[11:23:30] Dump 1 initiated: .\broken.exe_150713_112330.dmp
[11:23:30] Dump 1 complete: 1 MB written in 0.0 seconds
[11:23:31] Dump count reached.

您可能想要更改写入转储文件的位置并添加一些自动化,以便在生成转储时发出通知。

于 2015-07-13T16:36:05.653 回答