19


我刚刚开始使用 procdump,并且我希望在发生非主动的第二次机会异常时完整转储应用程序。
根据我运行的文档,它是这样的:

procdump.exe -ma -e -x C:\CrashDumps C:\Code\CrashApp\CrashApp\bin\Debug\CrashApp.exe

CrashApp.exe是一个简单的控制台应用程序,在启动时会引发异常。
这是我得到的输出:

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

Process:               CrashApp.exe (6516)
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:           C:\CrashDumps\
Dump filename/mask:    PROCESSNAME_YYMMDD_HHMMSS


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

CLR Version: v4.0.30319

[23:54:51] Exception: E0434F4D.System.Exception ("Hello World")

Unhandled Exception: System.Exception: Hello World
   at CrashApp.Program.Crash(String message) in c:\Code\CrashApp\CrashApp\Program.cs:line 18
   at CrashApp.Program.Main(String[] args) in c:\Code\CrashApp\CrashApp\Program.cs:line 13
[23:54:52] The process has exited.
[23:54:52] Dump count not reached.

如您所见,他报告了一个未经处理的异常,但没有创建转储。
我在这里做错了什么?

4

2 回答 2

21

由于.net存在标签,我怀疑您正在监视托管进程。如果是这样,那么添加-g命令行选项和 procdump 将按您的预期工作。

于 2014-10-23T09:32:25.223 回答
8

尝试使用参数e 1 -f -g

-e 1将告诉 procdump 捕获第一次机会(即已处理)异常以及未处理异常的转储文件,并且该-f参数将允许您过滤您关心的异常类型。

例如

procdump -ma -e 1 -f C00000FD.STACK_OVERFLOW -g -w CrashApp.exe

于 2016-08-08T14:27:39.133 回答