将 WinDbg 设置为默认调试器

发布于 2024-10-31 19:54:25 字数 161 浏览 3 评论 0原文

每当我的应用程序抛出未处理的异常时,我希望 WinDbg 在调试机器上捕获该异常,而不是 博士。 Watson等。如何配置?

Whenever my application throws an unhandled exception, I would like WinDbg to catch that exception on my debugging machine rather than Dr. Watson, etc. How can this be configured?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

童话 2024-11-07 19:54:25

运行 windbg -I 将其安装在默认事后调试器中。

正如 Kurt 在下面指出的那样,WinDbg 有 32 位和 64 位版本。执行 windbg -I 为与调试器位数相对应的进程设置事后调试器。

如果您需要同时使用 32 位和 64 位版本,则可以并行安装两个版本的 WinDbg。

来自帮助文件:

-I[S] 安装 WinDbg 作为事后调试器。详细信息请参见
启用事后调试。后
尝试此操作、成功或
显示失败消息。如果 S 是
包括,此程序已完成
如果成功就默默地做;仅有的
显示失败消息。 -I
参数不得与任何
其他参数。该命令将
实际上并没有启动WinDbg,尽管
WinDbg 窗口可能会出现一会儿。

Run windbg -I to install it at the default post mortem debugger.

As Kurt points out below WinDbg comes in both 32 and 64 bit versions. Executing windbg -I sets up the post mortem debugger for the processes corresponding to the bitness of the debugger.

You can install both versions of WinDbg side-by-side if you need to have both the 32 and 64 bit versions available.

From the help file:

-I[S] Installs WinDbg as the postmortem debugger. For details, see
Enabling Postmortem Debugging. After
this action is attempted, a success or
failure message is displayed. If S is
included, this procedure is done
silently if it is successful; only
failure messages are displayed. The -I
parameter must not be used with any
other parameters. This command will
not actually start WinDbg, although a
WinDbg window may appear for a moment.

谎言月老 2024-11-07 19:54:25

以下是用于将 WinDbg 设置为托管调试器和本机调试器的注册表文件:

Windows Registry Editor Version 5.00

;This reg file installs just-in-time debuggers to capture a dump of all process
;crashes for the machine.
;
;Assumes 32-bit debugger is cdb.exe and is installed to C:\debuggers\x86\.
;Assumes 64-bit debugger is cdb.exe and is installed to C:\debuggers\x64\.
;
;Assumes crash dumps can be written to C:\crash_dumps\.
;Make sure all users have write access to this directory.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework]
"DbgManagedDebugger"="\"c:\\debuggers\\x64\\windbg.exe\" -pv -p %ld "
"DbgJITDebugLaunchSetting"=dword:00000002


[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug]
"Debugger"="\"c:\\debuggers\\x64\\windbg.exe\" -pv -p %ld "
"Auto"="1"


;The following keys are only used on 64-bit versions of Windows (note Wow6432Node).
;They can be safely created with no side-effects on 32-bit versions of Windows.
;Alternatively, you can delete the remainder of this file if you’re running a
;32-bit version of Windows.


[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug]
"Debugger"="\"c:\\debuggers\\x86\\windbg.exe\" -pv -p %ld "
"Auto"="1"

当进程崩溃时自动捕获转储是 CLR 团队关于此问题的一篇文章。

Here is a registry file for setting WinDbg as the managed debugger and native debugger:

Windows Registry Editor Version 5.00

;This reg file installs just-in-time debuggers to capture a dump of all process
;crashes for the machine.
;
;Assumes 32-bit debugger is cdb.exe and is installed to C:\debuggers\x86\.
;Assumes 64-bit debugger is cdb.exe and is installed to C:\debuggers\x64\.
;
;Assumes crash dumps can be written to C:\crash_dumps\.
;Make sure all users have write access to this directory.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework]
"DbgManagedDebugger"="\"c:\\debuggers\\x64\\windbg.exe\" -pv -p %ld "
"DbgJITDebugLaunchSetting"=dword:00000002


[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug]
"Debugger"="\"c:\\debuggers\\x64\\windbg.exe\" -pv -p %ld "
"Auto"="1"


;The following keys are only used on 64-bit versions of Windows (note Wow6432Node).
;They can be safely created with no side-effects on 32-bit versions of Windows.
;Alternatively, you can delete the remainder of this file if you’re running a
;32-bit version of Windows.


[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug]
"Debugger"="\"c:\\debuggers\\x86\\windbg.exe\" -pv -p %ld "
"Auto"="1"

Automatically Capturing a Dump When a Process Crashes is a writeup about this from the CLR team.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文