crash generate dump

孤人 提交于 2019-12-11 00:07:30

问题


My application crashes occasionally at customer machine after running for 3-4 days. Is it possible to attach the application to a debugger like ADplus automatically when the application starts? This is for generating the dump file whenever the application crashes.


回答1:


Since you want to use ADPlus I assume a windows only solution will do it.
In this case you could install a post mortem debugger. It will pop up as soon as your app crashes. I usually use windbg.




回答2:


You may want to look at the SetUnhandledExceptionFilter function.




回答3:


IMO you wouldn't have to attach to the debugger when the process starts. Windows would look for a debugger when the process terminates and the location is set AeDebug RegistryKey

On x86 computer it is \\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AeDebug

CDB can be set as Postmortem debugger

To change the postmortem debugger to CDB, run cdb -iae or cdb -iaec KeyString. When the -iaec parameter is used, KeyString specifies a string to be appended to the end of command line used to launch the postmortem debugger. If KeyString contains spaces, it must be enclosed in quotation marks. This command will display no message if it succeeds, but will display a failure message if it fails. When CDB is the postmortem debugger, it will be activated whenever an application crashes.

I would have something like cdb -iaec ".dump /ma /u crashedapp.dmp;q" to get a memory dump when the process terminates.

And if the OS is Vista SP1+ then registry can be configured to get a full memory dump using WER http://msdn.microsoft.com/en-us/library/bb787181(VS.85).aspx



来源:https://stackoverflow.com/questions/6073135/crash-generate-dump

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