Using GDB in-system debugger

From Milkymist Wiki

Jump to: navigation, search

Contents

[edit] Compiling GDB

A patch is needed to make direct serial connections work. It was merged in GDB 7.3. Compile GDB with the target lm32-rtems4.11. Those steps should be included in the build scripts.

[edit] 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.

[edit] Running GDB

lm32-rtems4.11-gdb flickernoise.elf

[edit] Connecting to the target

[edit] Directly

Use these commands in GDB:

set remote interrupt-on-connect on
set remote interrupt-sequence BREAK
target remote /dev/ttyUSB0

[edit] 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.

[edit] Over JTAG

With OpenOCD.Does not work reliably yet.

[edit] Tips

To track down GDB connection problems:

set debug remote 1

[edit] GDB commands

When reporting a freeze, include at least the output from the backtrace command that gives a stack trace.

Personal tools