Using GDB with Avrora

New in Beta 1.4.0 is a feature that allows Avrora to be used to debug programs with gdb, the GNU debugger. A remote serial protocol allows Avrora to communicate with gdb over a socket and service requests. If you are already familiar with gdb, you can use its convenient interface and the flexibility of Avrora's profiling and monitoring to unlock even more powerful debugging techniques.

Currently, debugging with gdb and Avrora only works with a single node simulation.


Step 1 - Start Avrora's GDBServer

The first step is to start Avrora with a special monitor that creates a server socket which listens for a connection from GDB. By default, Avrora will listen for a connection on port 10001. To change this port, specify the -port option. Avrora will start up as normal, but the GDB server monitor will listen for a connection before starting the program.


Step 2 - Start GDB and Connect

The next step is to start avr-gdb and load the same program. To connect to Avrora, you can use the target gdb command.


Step 3 - Use GDB as Normal

Now that you are connected, you should be able to use gdb as normal, inserting breakpoints, stepping, and inspecting variables. The support for GDB in Avrora is not well developed yet. If you have trouble, try passing the -verbose=monitor.gdb to Avrora to see the communication. Report problems to the mailing list.