QEMU support a gdbserver known as the gdbstub. With this you can debug programs in both linux-user and system emulation modes.
$QEMU $QEMU_ARGS -s -S
Will configure the system and stop at the first instruction. You can then attach with:
gdb $BINARY -ex "target remote localhost:1234"
and debug your program
When running under TCG you can configure the debugger to not trigger timers and IRQs while debugging using the "qemu.sstepbits" custom message.
The gdbstub doesn't support all the features of the gdbserver protocol which is documented here