How to create minidump for my process when it crashes?

旧时模样 提交于 2020-01-08 12:29:26

问题


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


回答1:


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.




回答2:


Thanks all for viewing and replying special thanks to gimpf, I googled on internet and msdn.

I found an excellent article on debugInfo.com This is worth to read :

effective minidumps




回答3:


We use Google Breakpad in Firefox, although that requires at least Visual C++ 2003. The nice side benefit is that it also supports OS X and Linux.




回答4:


I ended up using CrashRpt on Windows (required me to move the whole codebase and toolchain from MinGW to native Microsoft C/C++ compiler), and google-breakpad on Linux.




回答5:


If you have a few bucks to spare AQtrace may be worth a look at. This has many of the advantages of the crash occurring inside the debugger, while running on a remote end user machine.



来源:https://stackoverflow.com/questions/1547211/how-to-create-minidump-for-my-process-when-it-crashes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!