在 WinDbg 中调试 devenv.exe 内存转储

Debugging devenv.exe memory dump in WinDbg

我想看看是什么导致我的 Visual Studio 2013 实例在我编码时一直挂起。我注意到当它挂起时,它在挂起期间在任务管理器中使用 1-3% CPU,所以我转储了 devenv.exe,它在任务管理器中被标记为 32 位进程 (*32)。当我在 32 位版本的 WinDbg 和 运行 .effmach 中打开它时,我得到:

0:000> .effmach
Effective machine: x64 (AMD64)

当我尝试加载 CLR 调试扩展时,我得到:

0:000> .loadby sos clr
The call to LoadLibrary(C:\Windows\Microsoft.NET\Framework\v4.0.30319\sos) failed, Win32 error 0n193
    "%1 is not a valid Win32 application."
Please check your debugger configuration and/or network access.

为了开心,我用 WinDbg 64 位打开了转储并尝试了以下操作:

0:000> .effmach
Effective machine: x64 (AMD64)
0:000> .loadby sos clr
0:000> !threads
SOS does not support the current target architecture.

我进退两难,无法调试 32 位或 64 位。我的问题是有人知道我应该使用哪个版本的 WinDbg,32 位还是 64 位,以及可以使用什么扩展来调试 devenv.exe 进程?

我也试过 psscor4:

0:000> .load c:\debugging\extensions\psscor4\x86\psscor4.dll
0:000> !clrstack
SOS does not support the current target architecture.

WinDbg 版本为 6.3.9600.16384

\Windows\SysWOW64 中有 32 位版本的任务管理器。如果您使用它而不是默认值,您将获得正确的 32 位转储。