我们什么时候应该捕获 DUMP 文件进行调试
假设我有一个 .NET 应用程序在关闭时崩溃,并且我想使用 DebugDiag 来查看发生了什么情况。所以我们应该创建一个转储文件。我的问题是我们什么时候创建这个转储文件?我应该在启动应用程序时创建它吗?好吧,如果我这样做,它会说已经在这个临时位置创建了转储文件...好吧..然后我继续处理应用程序并使其崩溃,但我的困惑是它很早就创建了转储文件,但是最后发生了崩溃,那么转储文件有什么用处呢?一旦我们使用该应用程序,它会自动更新吗?
Let's say I have a .NET application that crashes when I close it and I want to use DebugDiag to see what is going on. So we should create a dump file. My question is When do we create this dump file? Should I create it when I start the application? well if I do that it says a dump file has been created at this temp location...ok..then I continue working the application and make it to crash, but my confusion is that well it created the dump file very early, but crash happened at the end, so how even that dump file can be helpful? does it like get updated automatically once we are working with that application?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于崩溃(通常是未处理的异常),您应该在异常成为第二次机会异常时创建转储文件。我对 DebugDiag 不是很熟悉,但是 adplus(Windows 调试工具)和 ProcDump 等工具都可以让您为此创建转储。
在某些情况下,您可能还想为第一次机会异常创建转储(即在任何代码处理异常之前)。例如,如果导致崩溃的异常包含其他一些异常,那么您此时可能没有足够的信息。在这些情况下,在第一次出现异常时创建转储文件将为您提供有关原始异常状态的详细信息。
For a crash (which is usually an unhandled exception) you should create the dump file when the exception becomes a second chance exception. I am not very familiar with DebugDiag, but tools such as adplus (Debugging Tools for Windows) and ProcDump will both let you create dumps for this.
In some cases you may want to create dumps for first chance exceptions as well (i.e. before any code gets to handle the exception). E.g. if the exception which causes the crash wraps some other exception you may not have enough information at that point. In those cases creating dump files on first chance exceptions will give you detailed information on the state of the original exception.
您可以将 Windows 配置为在进程崩溃时创建转储文件。默认情况下不启用此功能:收集用户模式转储。 Windows XP 的过程有所不同: 捕获应用程序故障转储。获得转储文件后,您可以打开它并使用 WinDbg< /a>.我强烈推荐 Tess Fernandez 的博客和这个 图书。
You can configure windows to create dump files when the process crashes. This feature is not enabled by default: Collecting User-Mode Dumps. The process is different for Windows XP: Capturing Application Crash Dumps. Once you have the dump file you can open it and investigae with WinDbg. I highly recommend blog by Tess Fernandez and this book.