如何为我的进程崩溃时创建minidump?

编程入门 行业动态 更新时间:2024-10-11 19:18:39
本文介绍了如何为我的进程崩溃时创建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?

本文发布于:2023-11-07 02:04:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1565263.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:为我   进程   minidump

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!