Search
Close this search box.

Windows CE: Finding the cause of a Data Abort

For Windows CE 5.0 and 6.0 looking up the instructions that caused the Data Abort is easier than in previous versions.  The module name and offset are included in the Data Abort output.  Take the following case:

Exception 'Data Abort' (4): Thread-Id=00df0002(pth=87e31c98), Proc-
Id=00400002(pprc=81118308) 'NK.EXE', VM-active=015f0002(pprc=87e07b70) 'udevice.exe'
PC=c098704c(usbfn.dll+0x0001704c) RA=c09880b0(usbfn.dll+0x000180b0) SP=d03ce2d8, BVA=00000000

This output gives us some valuable information including the module that failed and the offset into the module that the failure occurred.  For this one, the module is usbfn.dll and the module offset (MO) is 0x000180b0.  Skip ahead to number 3 below.


But if you are using Windows CE 4.2 or prior, then you will need to do some work to get the module name and offset.  I have found that using the RA value, in your case 02ea2614, as your Exception Address (EA) works best.

  1. Look up EA in your makeimg output.  It falls between two modules code starts (CS).  The one with the lower number is the module with the problem.   In Platform Builder for Windows CE 4.x, the makeimg output is in the root folder of you project in <project name>.PLG.
  2. Then the Module Offset (MO) is EA-CS=MO. 
  3. For Windows CE 5.0 and later, MO = MO – 0x1000
  4. Look MO up in <module.map> in your target folder.  Similar to looking it up in the makeimg output, it will give you the function that caused the exception, and the function offset (FO).
  5. Now find the Instruction Offsett(IO) MO-FO=IO. 
  6. Now figure out which c/c++ file contains the function, look up the function in the corresponding .COD file, and find IO.  That is the assembly instruction that caused the exception, look up a few lines an you will see the C code.


If you don’t have the .COD files, set the environment variable WINCECOD=1
and rebuild.

Also see:  Platform Builder: Find the Source of a Data Abort; an Example

Summary of When Things Go Wrong

Tags: Data Abort

This article is part of the GWB Archives. Original Author: Bruce Eitman

Related Posts