Abnormal locating of data/prefetch abort in WinCE (through map file)

Source: Internet
Author: User
Tags prefetch

When debugging the wince program, sometimes the exception of data/prefetch abort may occur. I believe that those who have worked in wince development should be familiar with this exception information, the system will output the following similar information in the debug console:

Exception 'prefetch abort '(3): thread-id = 05870016 (PTH = 9970c000), comment', Vm-active = 057c0016 (PPRC = 9973cdd4) 'tcpclient.exe 'Pc = 00000004 (??? + 0x00000004) ra000000011254(tcpclient.exe + 0x00001254)
SP = 0011f954, BVA = 00000004

For example:

 

Prefetch abort and data abort are located in the same way.

In this example, the address in ra000000011254is abnormal. You can also use the address in tcpclient.exe + 0x00001254

0x00001254 + 0x00010000 = Ra = 00011254. Why is 0x00010000 added?

PS: ra000000011254(tcpclient.exe + 0x00001254) 00011254 is not necessarily accurate, or it is more reliable to use the addition calculation in parentheses --
Syrchina

Open the map file and find a piece of information about the preferred load address is 00010000, and you will understand the amount to add.

In the map file, find a value smaller than 0x000011254 and closest to it. In this program, the value is 0x00011108, for example:

 

It can be determined that a problem has occurred in the function. To locate the specific error on the row, you must use the. COD file to locate the problem.

The starting address of the socketthreadfunc function is 0x00011108, And the offset address of the error is:

0x14c = 000011254-0x00011108 (can be calculated using a Windows Calculator ). After calculating the offset address, open the cod file and find the location where 0x14c appears. You can use NotePad to open the cod file and use Ctrl + F to find 14C. The following information is located:

127 indicates that the error occurs in line 127th of the Code. The semicolon should be a comment.

 

By default, vs2005 does not generate the. Map and. COD files. You can generate these two files by modifying the following:

1. (. Map) file: Right-click the project directory and choose Properties> Configuration Properties> linker> debugging> Generate map file (Select Yes (/MAP ));

2. (. COD) file: Right-click the project directory and choose Properties> Configuration Properties> C/C ++> output files> er output (select assembly, machine code and source (/FACS )).

From: http://www.cnblogs.com/xFreedom/archive/2011/05/14/2046191.html

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.