How to make my code creating dump file before crash?

人走茶凉 提交于 2019-12-03 13:25:19

问题


I have some code in C# and C++ ( in one project ). This code have some crash and i trying t find it. but this crash is not reproduce any time - and i can't find it.

I want to configure the code / the windows OS to create dump file on the crash.

the limitation that i have are ... I have limited access to the machine that this crash reproduce on - this is not developing machine .. this is testing Lab machine

So, How to do it ? How can i change the properties in the solution that a new dump file will created on any crash?

(the aim is to be able to analyze the dump in the windbg tool)


回答1:


I find it easier to use ProcDump. Try the -e (create dump on unhandled exceptions), -ma (w/ full process memory), and -t (create dump on app termination) options.




回答2:


You can register an unhandled exception filter and PInvoke MiniDumpWriteDump. A code sample to do that is located here




回答3:


You can enable saving dumps on vista in the registry:

  1. Open RegEdit
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting
  3. Under Windows Error Reporting, create a new registry key named LocalDumps.


来源:https://stackoverflow.com/questions/10087458/how-to-make-my-code-creating-dump-file-before-crash

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