崩溃时如何为我的进程创建minidump? [英] How to create minidump for my process when it crashes?

查看:219
本文介绍了崩溃时如何为我的进程创建minidump?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法通过更改系统设置来创建我的进程的minidump。所以我的问题是




  • 系统会在崩溃时为用户进程创建一个minidump



    如果是,我需要配置


  • 或者我必须以编程方式创建minidump。 / p>


  • 调查崩溃时Minidumps的有效性




我正在使用Windows XP,C ++,VC6

解决方案

您需要以编程方式创建一个minidump(除了一个例外,请参阅下一个链接)。 CodeProject有一个很好的关于MiniDumps的文章。基本上,您要使用 dbghelp.dll ,并使用函数 MiniDumpWriteDump()(请参阅 MSDN on MiniDumpWriteDump )。



这种转储的有效性在很大程度上取决于应用程序。有时,对于优化的二进制文件,它们实际上是没用的。此外,没有经验,堆/堆栈损坏的错误会导致你误入歧途。



然而,如果优化器不是太难,你有一大类错误,帮助,即所有的本地使用的变量的堆栈跟踪值的值都是有用的,即许多纯虚函数调用的东西(即错误的破坏顺序),访问冲突(未初始化的访问或缺少NULL检查)等。



如果您的维护策略以某种方式允许,请将您的应用程序从VC6移植到可接受的内容,如VC8或9。你会自己做一个很大的帮助。


I am not able to create minidump form my process by changing system setting. So my Question is :

  • Will the system create a minidump for a user process when it crashes

    If yes, which setting do I need to configure

  • Or do I have to create minidump programmatically.

  • How effective are minidumps while investigating a crash

I'm using Windows XP, C++, VC6

解决方案

You need to programatically create a minidump (with one exception, see next link). CodeProject has a nice article on MiniDumps. Basically, you want to use dbghelp.dll, and use the function MiniDumpWriteDump() (see MSDN on MiniDumpWriteDump).

How effective such dumps are depends very much on the application. Sometimes, for optimized binaries, they are practically useless. Also, without experience, heap/stack corruption bugs will lead you astray.

However, if the optimizer was not too hard on you, there is a large class of errors where the dumps do help, namely all the bugs where having a stack-trace + values of the locally used variables is useful, i.e. many pure-virtual-function call things (i.e. wrong destruction order), access violations (uninitialized accessed or missing NULL checks), etc.

BTW, if your maintenance policy somehow allows it, port your application from VC6 to something acceptable, like VC8 or 9. You'll do yourself a big favor.

这篇关于崩溃时如何为我的进程创建minidump?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆