title: find where the interrupt happened on cortex-m4
body: <p>I am trying to find where in my code a specific interrupt happened. In this case it is on a stm32f4 microcontroller and the interrupt is the SysTick_Handler. </p>
  
  <p>What i want is basically to figure out from where the systick interrupt happened. I am using arm-none-eabi-gdb to try to find the backtrace, but the only information i am getting from there is:</p>
  
  <pre><code>(gdb) bt
  #0  SysTick_Handler () at modules/profiling.c:66
  #1  &lt;signal handler called&gt;
  #2  0x55555554 in ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?)
  </code></pre>
  
  <p>How can I get some information about where the program was before the interrupt fired?</p>
  
  <p>Looking at the arm documentation <a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0553a/Babefdjc.html" rel="nofollow">here</a>, it seems I should be able to read the stack pointer, and get the PC from there. But then this is exactly what the unwinder in GDB is doing isnt it?</p>