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

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

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

发布评论

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

>www.elefans.com

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