WinDbg to create crash dump file?

We have an exception to our application. Using Dr.Watson, we did not record dmp files or log files. I was told that WinDbg is an alternative to creating dump files in case of program exception / crash. After googling, I ran into heaps of confusion. First of all, I would like to confirm whether it is possible to create dump files using WinDbg. Secondly, are there any recommended simple command lines for attaching WinDbg to the application to receive dump files when it crashes? Many thanks!

+2
source share
4 answers

In this situation, we usually recommend that our users download procdump (which can be simply extracted from a zip file, no installation is required) and then we give them a batch file that contains something like this:

mkdir c:\dumps
procdump -e -c 10 -w myprocess.exe c:\dumps

When a process throws an unhandled exception, it will create a dump file in a directory c:\dumpsthat you can load into Visual Studio or Windbg (the command !analyze -vis your friend)

+3
source

Choosing the best tool confirms that WinDbg helps you create dump files, but also provides some alternatives that might be easier to use.

+2
source

, : http://msdn.microsoft.com/en-us/library/windows/desktop/ms680360%28v=vs.85%29.aspx

- , , : http://blogs.technet.com/b/askperf/archive/2007/06/15/capturing-application-crash-dumps.aspx http://social.technet.microsoft.com/wiki/contents/articles/8103.application-crash-dump-analysis-windows-7.aspx msdn

, - :

cdb -pn myApp.exe -c ".symfix;.reload;.dump /ma c:\memdump\crash.dmp;qd"

This assumes that the cdb.exe path is searchable, you may need a prefix with a full path, for example:

C:\Program Files (x86)\Debugging Tools for Windows (x86)\cdb -pn myApp.exe -c ".symfix;.reload;.dump /ma c:\memdump\crash.dmp;qd"

So the teams are here

cdb -pn   -->attaches cdb to your process name myApp.exe
-c        -->execute command
.symfix   -->fix microsoft symbols
.reload   -->reload
.dump /ma c:\memdump\crash.dmp --> write minidump to location (the flags /ma is effectively everything you want)
qd        -->quit and detach

You may not need some of these commands; you can remove them if they are not needed.

+1
source

All Articles