Use the map and COD files to find the crashed code line

Source: Internet
Author: User

// The map and COD files are generated at the end

 

Run debugProgramThe error message is as follows:

1. The error address is 0x00413202.

 

Search 00413 in the map file:

 

 

2. Find the largest 0x4131e0 value smaller than 0x00413202, and the function name is crashtest.

 

3. the offset of the crash address to the function address is 0x00413202-0x41_e0 = 0x22.

 

Find the crashtest function in the cod file where the function is located:

 

 

4. Check the row 0x22.

 

 

5. You can see error statements or even error operations.

 

----------------------------------------

To generate map and COD files, you must modify the debugging project settings. Take vs2008 as an example:

1. Set linker-debugging-generate map file to yes.

 

2. Set C/C ++-output files-assembler output to assembly, machine code and source (/FACS)

 

Note: The cod file is in the temporary compilation folder, along with the OBJ file.

-----------------------------------------

 

 

Reference:

Http://www.vckbase.com/document/viewdoc? Id = 908

Http://www.vckbase.com/document/viewdoc? Id = 1473

 

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.