Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ARM Data Abort error exception debugging

So now I understand that I'm getting a ARM Data Abort exception - I see how to trap the exception itself (a bad address in the STL library), but I would like to walk back up the stack frame before the exception. I'm using the IAR toolchain, and it tells me the call stack is unavailable after the exception - is there a trick way to convince the tool to show me the call stack? Thanks for all the quick help!

like image 973
Jeff Avatar asked Aug 31 '09 23:08

Jeff


People also ask

What is a data abort exception?

A data-abort exception is a response by a memory system to an invalid data access. The data-abort exception handler is a program that can inform the programmer where in his or her code this exception has occurred (after the application has crashed).

What causes data abort?

A Data Abort exception can be generated by: A synchronous abort on a data read or write memory access. Exception entry is synchronous to the instruction that generated the memory access.

What is the difference between data abort and prefetch abort exceptions?

A prefetch abort is associated with an instruction fetch as opposed to a data access. When a prefetch abort occurs, the processor marks the prefetched instruction as invalid, but does not take the exception until it executes the instruction.

What is prefetch abort in arm?

A Prefetch Abort occurs when you try to execute code from non-existing memory regions. The Philips LPC2000 device does not have memory at 0x41000000 (some LPC22xx variants have external memory at 0x81000000). So it looks like you are intermixing the address ranges somehow.


1 Answers

if you look at the ARM ARM (ARM Architecture Reference Manual, just google "arm arm"), Programmers Model -> Processor modes and Registers sections. When in abort mode you are priveledged so you can switch from abort to say supervisor and then make a copy of r13, then switch back to abort mode and dump the stack from the copy of r13. Your r14 also tells you where the abort occurred.

I wouldnt be surprised if this abort was from an alignment. Trying to read/write a word with an address with something other than zeros in the lower two bits or a halfword with the lsbit of the address set. Actually if you take the link register and a dump of the registers (r0-r12) since abort and user/supervisor use the same register space, you can look at the instruction that caused the abort and the address to see if it was indeed an alignment problem or something else. Note that the pc is one, two or three instructions ahead depending on the mode thumb or arm that had the abort, if you are not using thumb at all then this nothing to worry about.

like image 96
old_timer Avatar answered Sep 28 '22 16:09

old_timer