崩溃时如何为我的进程创建小型转储?

How to create minidump for my process when it crashes?(崩溃时如何为我的进程创建小型转储?)
本文介绍了崩溃时如何为我的进程创建小型转储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法通过更改系统设置从我的进程中创建小型转储.所以我的问题是:

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

我使用的是 Windows XP、C++、VC6

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

推荐答案

您需要以编程方式创建小型转储(有一个例外,请参阅下一个链接).CodeProject 有一篇不错的关于 MiniDumps 的文章.基本上,您想使用 dbghelp.dll,并使用函数 MiniDumpWriteDump()(请参阅 MiniDumpWriteDump 上的 MSDN).

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.

但是,如果优化器对您不是太苛刻,那么转储 do 会帮助您解决一大类错误,即所有具有堆栈跟踪 + 本地值的错误使用的变量很有用,即许多纯虚函数调用的东西(即错误的销毁顺序)、访问冲突(未初始化的访问或缺少 NULL 检查)等.

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.

顺便说一句,如果您的维护政策以某种方式允许,请将您的应用程序从 VC6 移植到可接受的版本,例如 VC8 或 9.您会帮自己一个大忙.

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.

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

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Rising edge interrupt triggering multiple times on STM32 Nucleo(在STM32 Nucleo上多次触发上升沿中断)
How to use va_list correctly in a sequence of wrapper functions calls?(如何在一系列包装函数调用中正确使用 va_list?)
OpenGL Perspective Projection Clipping Polygon with Vertex Outside Frustum = Wrong texture mapping?(OpenGL透视投影裁剪多边形,顶点在视锥外=错误的纹理映射?)
How does one properly deserialize a byte array back into an object in C++?(如何正确地将字节数组反序列化回 C++ 中的对象?)
What free tiniest flash file system could you advice for embedded system?(您可以为嵌入式系统推荐什么免费的最小闪存文件系统?)
Volatile member variables vs. volatile object?(易失性成员变量与易失性对象?)