Dump File generation and analysis

Source: Internet
Author: User

I have studied dump file-related knowledge due to project requirements in the last two days. Today I am going to make a small section (because the study is not long and I am writing a blog for the first time, I hope that my friends will not laugh at it ).

The dump file is the memory image of the process. It can save the running state of the program to the dump file through the debugger.

The dump file is used to debug the driver for drivers. Such a file must be opened using a dedicated tool software, for example, windbg.

After our program is published, we cannot track bugs in our own code on the client, so the dump (Extension:. dmp) file is especially useful for us. We can reproduce bugs Through the. dmp file, and then find the bug line number, or even the point where the bug occurs, based on the reproduction (including the stack call and so on.

Through research, I have summarized two methods, for example:

(1) install windbg, detailed way to license: http://blog.csdn.net/oeichenwei/archive/2009/05/19/4201590.aspx

(2) through the windows system (My WINXP), Ghost: http://blog.csdn.net/wangyangtao/archive/2010/03/08/5355841.aspx

 

Of course, my approach is different from the above two URLs (based on learning the above). My detailed practices are as follows:

(1) install windbg

(A) download and install windbg (the installation method is not described in detail)

(B) Open windbg, file/attach to a process/and then show the required route (.exe)

(C) When the program crashes, run the dump command to generate the DMP file. The Commands include :. dump/m c:/dumps/MyApp. DMP ,. dump/Ma C:/dumps/MyApp. DMP ,. dump/mfhuwd C:/dumps/MyApp. dmp

The DMP file is generated when the above Code is run.

 

(2) using Windows

First, use Dr Watson to input drwtsn32.exe-I in the execution to install Dr Watson as the default application debugging program.

Enter the settings of drwtsn32.exe in execution:

The log file path is the folder where the dump file is to be placed. The fault dump is the location of the dmup file in the folder.

Select command and error count to write more points

Select 1, 2, 3, and 6 for type selection.

When the program crashes, Dr Watson will generate a dump file in the Set folder.

 

The dump file is generated in the above two ways, and the analysis is left below. We use two methods for analysis.
(1) windbg Analysis

(A) Open windbg, file/sybolm file path/Specify the path generated by. PDB when the EXE is published

(B) file/Open crash dump/open the generated DMP File

(C) Use the windbg command to analyze bugs, such as the command :! Analyze-V

(D) You can also use the shortcut bar function to view the basic information of some variables to help you view bugs.

 

(2) Through vs2005 analysis, the method according to the Web site: http://www.cppblog.com/woaidongmao/archive/2009/10/21/99135.html

 

The above is a section of my recent two-day study, which is the result of others. I am writing a blog for the first time. If you have an ambiguous or better way, I hope you will give me some advice!

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.