ARM Backtracing support

Mentor Holger Freyther
Skills C and Assembly
Length 20 days


Writing firmware (specially without JTAG) can be error prone and one can have various kind of crashes (full stack, running out of memory, etc). Tools like mudflap, valrgind might not be usable. One thing that would help is to have a generic backtrace framework. On illegal memory access the ARM core will jump to a signal handler (e.g. data abort, illegal instruction, etc.) we should be able to branch to the error handler from there before the reset


  • Compile the firmware with framepointers. This way it will be possible to find the frame, previous frame, previous previous frame.
  • Change the firmware to setup a stack for the abort handlers.
  • Create a C routine that given the address of a framepointer will unwind the stack and print the addresses
  • Write a script using objdump to convert the addresses back to functions and line numbers.