Dump file generation and analysis

Source: Internet
Author: User

The recent two days because of the needs of the project, study the dump file related knowledge, today to do a subsection (because the study soon and the first time to write a blog, I hope that netizens see not laughed at).

The dump file is a memory image of the process. Be able to save the program's running state through the debugger to the dump file.

Dump files are used to debug drivers for driver writers, and such files must be opened with specialized tool software, for example, with WinDbg.

The dump (. dmp) file is especially useful for us when our program is published and the client is unable to track its own code bugs. We can reproduce the bug by using the. dmp file, and then we can find the line number of the bug, or even the point where the bug occurred, based on the status of the rendition (including Stack calls).

Through research, I summed up two ways, such as the following:

(1) Installation WinDbg, detailed way to participate: http://blog.csdn.net/oeichenwei/archive/2009/05/19/4201590.aspx

(2) via Windows System mode (my is WinXP), Photo: Http://blog.csdn.net/wangyangtao/archive/2010/03/08/5355841.aspx

Of course my way is not the same as in the above two URL (learn above on the basis of doing), my detailed approach is:

(1) Installation WinDbg

(a) Download and install the WinDbg (installation method not to repeat)

(b) Open WinDbg, File/attach to a process/and then display the processes (. exe) that need to be monitored in the list

(c) When the program crashes, run the DUMP command to produce the DMP file, with the command:. dump/m c:/dumps/myapp.dmp,. Dump/ma c:/dumps/myapp.dmp,. DUMP/MFHUTWD C:/dumps/myapp . DMP

Running above produces a DMP file

(2) via Windows System mode

First use Dr Watson to enter Drwtsn32.exe–i in execution to install Dr Watson as the default application debugger.

Then enter the Drwtsn32.exe setting in the execution:

The log file path is the folder where you want to place the dump file, and the crash dump is the Dmup file location under that folder

Select instruction and number of errors to write multiple points

Type select complete Option 1 2 3 6 item (optional)

When the program crashes, Dr Watson generates a dump file under the Settings folder

In the above two ways to generate a dump file, the following is the rest of the analysis. We analyze it in two ways.
(1) Analysis of WinDbg mode

(a) Open Windbg,file/sybolm File path/Specifies the time to advertise EXE. Path generated by PDB

(b) File/open Crash dump/Open the generated DMP file

(c) Use the WinDbg command to parse a bug, such as a command:!analyze-v

(d) also be able to use the function of the shortcut bar to view the basic information of some variables to help view the bug

(2) Through VS2005 analysis, method of the website: http://www.cppblog.com/woaidongmao/archive/2009/10/21/99135.html

The above is a section of my recent two-day study, which is a result of others. For the first time to write a blog, if there is not clear or a more sophisticated way, I hope you enlighten!

Dump file generation and analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.