Joshua Otto
unread,May 17, 2016, 6:00:08 PM5/17/16You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi all! My partner and I managed to get remote debugging with GDB working
using the RedBoot GDB stubs. This makes it possible to step through the
kernel, examine register contents, set breakpoints, etc. while running it on
the actual hardware in the lab. Here's the setup we worked out:
1) You'll need a multi-arch build of GDB available on your local machine. My
partner and I both use Ubuntu, so we installed the 'gdb-multiarch' package.
2) You'll need the IP address of the box you're going to be running on. This
is printed to the RedBoot console on every reset.
3) You'll need a local copy of your .elf binary (compiled with debugging
symbols) and source code.
4) You'll need to make TCP port 9000 of the box accessible to your local
machine somehow. Plugging into the ethernet in the lab permits this directly,
but if you can't do that we also had success with forwarding the port through
the student Linux environment.
5) To start a debugging session:
> gdb-multiarch your-kernel.elf
target remote tcp:<IP of the box>:9000 load
If everything went well, you should be at the beginning of your program and
ready to run it with 'continue'. Dumping the registers with 'info reg' should
show pc pointing to the first instruction of main, etc.
We needed to compile with the gcc-4.9 build posted about earlier to get
working backtraces, but it should mostly work with 4.0.2.