[英]How do I take a good crash dump for .NET?
I have captured a crash dump of my 32 bit .NET application running on a 64 bit Windows operating system. 我捕获了在64位Windows操作系统上运行的32位.NET应用程序的故障转储。 During the analysis somebody found out that I have a 64 bit dump and told me that it is not possible to analyze this dump due to wrong bitness. 在分析过程中,有人发现我有一个64位转储并告诉我由于错误的位数而无法分析这个转储。
When using Windows Task Manager to create the dump, I was not aware that I was doing something wrong. 使用Windows任务管理器创建转储时,我不知道我做错了什么。 This always worked for 32 bit operating systems. 这始终适用于32位操作系统。
How can I take a good dump for .NET, especially with the correct bitness? 我怎样才能为.NET提供良好的转储,尤其是正确的位数?
The bitness matters for .NET applications for the following reasons: 对于.NET应用程序而言,这一点很重要,原因如下:
It is not possible to convert a dump from 64 bit to 32 bit, although in theory it should contain all necessary information. 将转储从64位转换为32位是不可能的,尽管理论上它应该包含所有必要的信息。
If you're feeling lucky, you can also try some of the instructions anyway 如果你感到幸运,你也可以尝试一些指示
If you don't know the bitness, you can find it out like this: 如果你不知道它的位数,你可以这样找到它:
Windows 7 Task Manager shows *32
on processes: Windows 7任务管理器在进程上显示*32
:
In Windows 8 task manager, go to the Details
tab and add a column named Platform
: 在Windows 8任务管理器中,转到“ Details
选项卡并添加名为“ Platform
的列:
Visual Studio shows the bitness when attaching to the process: Visual Studio在附加到进程时显示位数:
Process Explorer can be configured to show the Image Type
column: 可以将Process Explorer配置为显示“ Image Type
列:
Programs which detect bitness automatically: 自动检测位数的程序:
Tools which capture a dump with specific bitness: 捕获具有特定位数的转储的工具:
-64
command line switch 64位: ProcDump使用-64
命令行开关运行 Just choose the bitness according to your application, not according the OS. 只需根据您的应用选择位数,而不是根据操作系统。
For .NET you need a full memory dump, otherwise you cannot figure out the content of the objects. 对于.NET,您需要一个完整的内存转储,否则您无法弄清楚对象的内容。 To include full memory, do the following: 要包含完整内存,请执行以下操作:
/ma
when doing .dump
在WinDbg中,在执行.dump
时指定/ma
-ma
command line switch 在ProcDump中 ,应用-ma
命令行开关 DumpType
to 2
对于Windows错误报告LocalDumps将DumpType
设置为2
I found out that many developers aren't even aware that Visual Studio can create dumps. 我发现很多开发人员甚至都不知道Visual Studio可以创建转储。 The reason probably is that the menu is invisible for a long time. 原因可能是菜单长时间不可见。 These are the steps: 这些是步骤:
Probably just for debugging the WoW64 layer itself. 可能仅用于调试WoW64层本身。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.