使用procdump侦听所有异常不起作用 [英] Using procdump to listen to all exceptions doesn't work

查看:43
本文介绍了使用procdump侦听所有异常不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望 procdump 监听所有异常(无需指定进程名称或ID).

I want procdump to listen to all exceptions (without having to specify a process name or id).

此处给出的示例,我以为使用以下应该起作用:

From an example given here, I thought using the following should work:

procdump -ma -i

...但是尽管我收到以下消息:

...but although I get the message following message:

ProcDump is now set as the Just-in-time (AeDebug) debugger.

...当某些进程中发生异常时,不会丢弃任何内容.

...when an exception occurs in some process, nothing gets dumped.

故意从以下.NET代码中引发异常:

The exception is intentionally thrown from the following .NET code:

using System;

namespace ProcdumpTest
{
    class Program
    {
        static void Main(string[] args)
        {
            if (ShouldAwaitKeyPress(args)) Console.ReadLine();
            Throw();
        }
        static void Throw()
        {
            throw new InvalidOperationException();
        }
        static bool ShouldAwaitKeyPress(string[] args)
        {
            var shouldAwaitKeyPress = false;
            if (args.Length > 0)
            {
               bool.TryParse(args[0], out shouldAwaitKeyPress);
            }
            return shouldAwaitKeyPress;
        }
    }
}

编译它并使用 ProcdumpTest ProcdumpTest false 运行,以便立即引发异常,或者使用 ProcdumpTest true 运行,以便等待进行按键操作.

Compile it and run with either ProcdumpTest or ProcdumpTest false so that an exception is thrown immediately, or with ProcdumpTest true so that it waits for a keypress to throw.

推荐答案

感谢@Sebastian的帮助:

Solved thanks to @Sebastian's help:

我最初在 C:\ Program Files 下安装了 procdump ,这需要管理员权限,尽管我在 procdump -i -ma 下执行了管理员运行命令cmd procmon指示转储文件的写访问被拒绝.

I initially installed procdump under C:\Program Files, which requires admin permissions, and although I executed procdump -i -ma under a run-as-administrator cmd, procmon indicated that the dump file write-access was denied.

将目标转储文件夹更改为非管理员文件夹后,转储已成功创建:

After changing the destination dump folder to a non-admin folder, the dump was successfuly created:

procdump -ma -i c:\path\to\some\non\admin\folder

这篇关于使用procdump侦听所有异常不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆