如何禁用/启用dr.watson诊断工具 drwtsn32 / 如何在vista下生成转储文件dump

来源:互联网 发布:php优秀的crm开源系统 编辑:程序博客网 时间:2024/05/18 03:00

本文转自 http://blog.csdn.net/zdl1016/archive/2009/03/14/3986530.aspx

 

要禁用 Dr. Watson,请按照下列步骤操作
< type="text/javascript">

单击开始,单击运行,在打开框中键入 regedit.exe,然后单击确定。
找到并单击以下注册表项:
HKEY_LOCAL_MACHINE/Software/Microsoft/Windows NT/CurrentVersion/ AeDebug
注意:步骤 3 和步骤 4 是可选的;如果您要还原使用 Dr. Watson 的默认设置,则需要执行这两个步骤。
单击 AeDebug 项,然后单击注册表菜单上的导出注册表文件。
为要保存的注册表文件输入名称和位置,然后单击保存。
删除 AeDebug 项。
在 Windows 中,调试程序的注册表项位于 AeDebug 项中。默认情况下,Dr. Watson 程序安装在 Windows 中,并配置为在发生应用程序错误时运行(Auto 值的数据值为 1)。默认值为:

数值名称 = Auto
类型 = 字符串 (REG_SZ)
数据值 = 1 或 0。(默认值为 1)

数值名称 = Debugger
类型 = 字符串 (REG_SZ)
数据值 = drwtsn32 -p %ld -e %ld -g

注意:该数据值 (drwtsn32 -p %ld -e %ld -g) 是 Dr.Watson 专有的。其他调试程序将具有它们自己的值和参数。
///////////////////////////////////

启用
步骤1:
drwtsn32 -i
步骤2:
修改注册表.使和上面的的注册表值一样, 不然,生成日志的.
数值名称 = Auto
类型 = 字符串 (REG_SZ)
数据值 = 1 或 0。(默认值为 1)

数值名称 = Debugger
类型 = 字符串 (REG_SZ)
数据值 = drwtsn32 -p %ld -e %ld -g
其中注册表我已经放在gmail的邮箱里了.
//
如何修改是vc2005成为默认的调试器
数值名称 = Auto
类型 = 字符串 (REG_SZ)
数据值 =  0

数值名称 = Debugger
类型 = 字符串 (REG_SZ)
数据值 = "C:/WINDOWS/system32/vsjitdebugger.exe" -p %ld -e %ld

其中注册表我已经放在gmail的邮箱里了.


//修改windbg为默认的调试器,
1) 保证注册表里面有AeDebug项
2) 运行 windbg -I
    注意, I必须是大写!!!!

//修改windbg为默认的调试器, 并且当有任何程序崩溃的时候,自动生成dump文件
Debugger = “Path/WinDbg.exe" -p %ld –c “.dump /ma /u C:/CrashDump.dmp” -e %ld –g

NOTE :


1) Be careful with the registry changes. Execute the test.exe to verify that the registry changes are correct. When you run test.exe the application will automatically bring up the debugger and generate a crashdump.dmp file in C:/ drive


2) -c option should immediately come after -p %ld

注册表的含义,参见
http://www.codeproject.com/KB/debug/automemorydump.aspx

How to automatically generate a memory dump file:
如何自动产生一个memorp dump 文件?

We need to modify the registry for this.

Editing the Registry

On an x86 computer, the postmortem settings are stored in the //HKEY_LOCAL_MACHINE/Software/Microsoft/Windows NT/CurrentVersion/AeDebug key.

There are two registry values that should appear in these keys:

Debugger

This REG_SZ value specifies the debugger that will handle postmortem debugging. The full path to the debugger must be listed, unless the debugger is located in a directory that is in the default path.

Auto

This REG_SZ value is always either 0 or 1. If Auto is set to 0, a message box will be displayed prior to postmortem debugging.

When an unhandled application error occurs, Windows checks to see if the Debugger and Auto registry values exist.

If the Auto value is 0, a message box will appear.

In Windows NT and Windows 2000, the message box will have one of the following formats:

If the Debugger value contains the name of a valid debugger or Dr. Watson, the message box will have two buttons: OK and Cancel. If the OK button is pressed, the application will be terminated. If the Cancel button is pressed, the tool specified in the Debugger value will be started.
If the Debugger value is empty, the message box will have only an OK button and no debugger will start.
 

如何在vista下生成转储文件dump

在 Windows Vista 中不包括 Dr.Watson,请按照下列步骤操作。 Dr.Watson 是默认早期 Windows 操作系统中的调试程序。 问题报告和解决方案,将是 Dr.Watson,请按照下列步骤操作,替代控件。 可以在控制面板中配置问题报告和解决方案。 但是,您不能使用问题报告和解决方案创建完整的用户模式转储文件。

回到顶端
如何在 Windows Vista 中创建完整的用户模式转储文件
< type="text/javascript"> 重要 此部分、 方法,或任务包含告诉您如何修改注册表的步骤。 但是,如果错误地修改注册表,就可能发生严重的问题。 因此,请确保认真执行这些步骤。 添加的保护注册表之前先备份您修改它。 然后,发生问题时可以还原注册表。 有关如何备份和还原在注册表的详细信息,单击下面的文章编号,以查看 Microsoft 知识库中相应:

322756  (http://support.microsoft.com/kb/322756/ ) 如何备份和还原在 Windows 注册表
获取,然后再安装 Windows 调试工具。 若要 to Windows 调试工具请访问下面的 Microsoft Web 站点:
http://www.microsoft.com/whdc/devtools/debugging/default.mspx (http://www.microsoft.com/whdc/devtools/debugging/default.mspx)
单击 开始 ,然后单击 运行 。
复制,然后粘贴 (或类型) 下面的命令,在 打开 框和然后按 ENTER 键:
regedit
查找,并单击以下注册表子项:
HKEY _ LOCAL _ MACHINE/SOFTWARE/Microsoft/Windows NT/CurrentVersion/AeDebug
在 编辑 菜单上指向 新建 ,然后单击 字符串值 。
键入 调试器 ,然后按 ENTER 键。
右键单击 调试器 ,然后单击 修改 。
编辑字符串值 对话框中,键入 C:/debuggers/ntsd-p %ld-c".dump / f / u c:/tmp/mydump.dmp;q",然后单击 确定 。 在此示例中,Windows 调试工具目录将是 C:/Debuggers。
在 编辑 菜单上指向 新建 ,然后单击 字符串值 。
键入 自动 ,然后按 ENTER 键。
右键单击 自动 ,然后单击 修改 。
编辑字符串值 对话框中,键入 1 ,然后单击 确定 。
退出注册表编辑器。
如果应用程序崩溃,将在步骤 8 中指定 C:/Tmp 目录中创建完整的用户模式转储文件。

 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/zdl1016/archive/2009/03/14/3986530.aspx

原创粉丝点击