标签:
prefetch abort 是一类比较难解决的问题,因为很难定位出错的位置。
更奇怪的是:程序单独运行就会出错,使用VS2008按 F5 运行就不会出错。更不用想单步调试了,也不会出错啦!
类似于 Data Abort 的错误,prefetch abort 可能的原因有:
1)操作过程中有Bug,内容被修改;
2)内存重新映射以后,出错的地址处的内容没有初始化;arm,linux,winbond,nuvoton,w90p710,w90n745, 开源,嵌入式,操作系统,嵌入式开发,嵌入式联盟,linux,ecos,uclinux,t- kernel,freeos,rtems,ucos,skyeye, y1 p) [1 d0 F, ]/ T2 K- W - 我们只做简洁、实用、专业的嵌入式开发技术论坛。0 m2 `# m& a- d2 H3 P8 n 3)PC指针无效;
在网上查找到有这样一篇文章:
转载其内容:
Prefetch aborts can be difficult to locate and fix. To understand why, we first need to understand what a prefetch abort is. A prefetch abort occurs when the CPU runs out of instructions in its pipeline. But that can also mean that a zero instruction is in the pipeline.
Possible causes of prefetch aborts:
1 void CausePrefetchPointerAbort() 2 { 3 // declare a function pointer and set it to NULL 4 DWORD (* BadFunction)() = NULL; 5 // dereference the NULL function pointer (setting the PC to zero 6 BadFunction(); 7 }
1 DWORD SetToZero( DWORD *Param ) 2 { 3 *Param = 0; 4 RETAILMSG( 1, (TEXT("Param %X %d"), Param, *Param )); 5 } 6 void CausePrefetchStackAbort( int Count ) 7 { 8 DWORD *Array; 9 int Index; 10 RETAILMSG( 1, (TEXT("Start CausePrefetchStackAbort( %d )/n"), Count)); 11 // set the ponter to the address of index which is on the stack. I tried to use an array 12 // but the compiler put it into global variables instead of the stack. 13 Array = &Index; 14 // Loop through Count DWORDS and set the data to zero. This data is on the stack 15 // so we are clearing the stack. 16 for( Index = 0; Index < Count; Index++ ) 17 { 18 SetToZero( Array ); 19 Array++; 20 } 21 RETAILMSG( 1, (TEXT("returning CausePrefetchStackAbort( %d )/n"), Count)); 22 }
So the problem with prefetch aborts is that the abort message doesn‘t always give much to go on to track back to the cause. When it does, we can use that to find the problem in the code. I will cover that in a post on Data Aborts soon.
标签:
原文地址:http://www.cnblogs.com/91program/p/5208713.html