使用windbg(或mscordmp)为托管(.net)应用程序创建转储文件
我正在考虑为托管进程创建转储文件。
我知道我可以使用 Windbg 创建转储文件,但我想知道它们是否是我应该传递给“.dump”命令的任何特殊标志,因为它是一个托管应用程序而不是本机应用程序。
一个相关的附带问题:我听说过一个名为 mscordmp.exe 的工具(如果你用谷歌搜索它,你可以在网上找到它的提及)。 mscordmp 仍然相关吗?我在任何地方都找不到它的下载点,但我认为它可能比 Windbg 更适合转储托管内存。
I'm looking into creating dump files for a managed process.
I know that I can use windbg to create a dump file, but I'm wondering if their are any special flags that I should pass to the ".dump" command, given that it's a managed application instead of a native one.
a related side question: I've heard of a tool called mscordmp.exe (if you google it, you can find mention of it online). Is mscordmp still relevant? I can't find a download point for it anywhere, but I thought it might be better suited for dumping managed memory than windbg.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该使用 /ma 创建完整内存转储。
否则,sos 会抱怨管理分析非常有限。
You should use /ma to create full memory dump.
Otherwise sos will complain that managed analysis will be very limited.
不,没有任何与托管应用程序相关的特殊标志,windbg 只是创建内存转储,它是原始数据。分析工具的目的是了解您的转储是为托管应用程序还是非托管应用程序创建的。
如果谈到分析托管应用程序,可以执行以下步骤:
windbg
附加到正在运行的托管应用程序.dump /ma
。它创建转储文件,此操作可能需要大约几分钟,具体取决于进程消耗的内存。 /ma 标志命令在启用所有选项的情况下创建附加进程的完整内存转储(它不是完整的系统转储,只是附加进程)。ps 使用
.load sos.dll
启用 sos.dll 可能会出现问题,在这种情况下,您可以尝试.loadby sos mscorwks
。No, there's no any special flags related to managed application, windbg just creates memory dump, it's raw data. It is the purpose of your analysis tool to know whether your dump was created for managed application or unmanaged.
If speaking about analysing managed application, you there can be the following steps:
windbg
to process running managed application.dump /ma <outputfilename.dmp>
. It creates dump file, this operation can take about several minutes depending on memory consumed by process. The/ma
flag orders to create full memory dump of attached process with all options enabled (it is not full system dump, only attached process).windbg
and analyse it.windbg
extension for analysing managed applications.p.s. There can be problem enabling sos.dll with
.load sos.dll
, in that case you can try.loadby sos mscorwks
.