問題描述
我無法通過更改系統設置從我的進程中創建小型轉儲.所以我的問題是:
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.
這篇關于崩潰時如何為我的進程創建小型轉儲?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!