title: How to single step ARM assembly in GDB on QEMU?
body: <p>I'm trying to learn about ARM assembler programming using the GNU assembler.  I've setup my PC with QEmu and have a Debian ARM-HF chroot environment.</p>
  
  <p>If I assemble and link my test program:</p>
  
  <pre><code>.text
  .global _start
  _start:
          mov     r0, #6
          bx      lr
  </code></pre>
  
  <p>with:</p>
  
  <pre><code>as test.s -o test.o
  ld test.o -o test
  </code></pre>
  
  <p>Then load the file into gdb and set a breakpoint on _start:</p>
  
  <pre>
  root@Latitude-E6420:/root# gdb test
  GNU gdb (GDB) 7.6.1 (Debian 7.6.1-1)
  Copyright (C) 2013 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later 
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "arm-linux-gnueabihf".
  For bug reporting instructions, please see:
  ...
  Reading symbols from /root/test...(no debugging symbols found)...done.
  (gdb) break _start
  Breakpoint 1 at 0x8054
  (gdb)
  </pre>
  
  <p>How do I single step the code, display the assembler source code and monitor the registers?
  I tried some basic commands and they did not work:</p>
  
  <pre>
  (gdb) break _start
  Breakpoint 1 at 0x8054
  (gdb) info regi
  The program has no registers now.
  (gdb) stepi
  The program is not being run.
  (gdb) disas
  No frame selected.
  (gdb) r
  Starting program: /root/test 
  qemu: Unsupported syscall: 26
  qemu: uncaught target signal 11 (Segmentation fault) - core dumped
  qemu: Unsupported syscall: 26
  During startup program terminated with signal SIGSEGV, Segmentation fault.
  (gdb) 
  </pre>