Using GDB in-system debugger
From Milkymist Wiki
 Compiling GDB
 Obtaining Flickernoise debug information
When building Flickernoise, the file
bin/flickernoise.elf contains the debug information. Starting with Flickernoise 1.0RC1, this file is provided with the releases to make debugging easier. With
earlier versions, you have to compile Flickernoise yourself (the build scripts automate that).
Make sure the
.elf file and the code that the M1 is running are in sync! If in doubt, netboot the binary that was just built.
 Running GDB
 Connecting to the target
Use these commands in GDB:
set remote interrupt-on-connect on set remote interrupt-sequence BREAK target remote /dev/ttyUSB0
 With flterm pass-through
To use it start flterm with --gdb-passthrough. Then start gdb and run the following commands:
set remote interrupt-on-connect on target remote <pseudo terminal printed by flterm>
Note: there is _no_ 'set remote interrupt-sequence BREAK'. flterm takes care of converting Ctrl+C (ETX) to a BREAK.
 Over JTAG
With OpenOCD.Does not work reliably yet.
To track down GDB connection problems:
set debug remote 1
 GDB commands
When reporting a freeze, include at least the output from the
backtrace command that gives a stack trace.