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

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

问题描述

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




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



    如果是,需要配置哪个设置


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


  • 在调查崩溃时minidum的有效性




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

解决方案

您需要以编程方式创建一个minidump下一个链接)。 CodeProject在MiniDumps上有一个不错的文章。基本上,您要使用 dbghelp.dll ,并使用函数 MiniDumpWriteDump()(请参阅 MiniDumpWriteDump上的MSDN )。



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



但是,如果优化器不是太难,有一个大类的错误,转储帮助,即具有本地使用的变量的stack-trace +值的所有错误是有用的,即许多纯虚函数调用事物(即错误的销毁顺序),访问违反(未初始化访问或缺少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天全站免登陆