6809 GDB

XRoar will now operate as a GDB remote target when run with the -gdb option. This allows remote memory & register inspection/modification, breakpoints and some extended queries.

Some basic commands can be used to interact with it from any recent GDB, but it's better if GDB itself supports 6809 disassembly. Here is a git repository containing a clone of GDB, and the necessary additions in a separate branch. The current patch is against GDB 7.6.

$ git clone -b m6809-7.6 https://www.6809.org.uk/git/binutils-gdb.git

2016-05-30: This repository has changed because the source repository for GDB changed. It is now based on git://sourceware.org/git/binutils-gdb.git. Note that rebasing onto the current master will likely now fail, as GDB has changed architecturally somewhat since this branch was made.

Build & install with:

$ cd binutils-gdb
$ ./configure --target=m6809 --disable-werror
$ make
$ make install

The resulting binary should be named m6809-gdb.

Note: --disable-werror is required on the configure line with more recent versions of gcc.

As building for Windows is a bit more of a chore, here's a pre-built executable: m6809-gdb.exe.

2020-06-14: Pere Serrat reported that 6309 registers were not displaying properly. Hopefully fixed in the m6809-7.6 branch.

2014-04-21: Tormod Volden has pointed out an issue with long branch disassembly - hopefully fixed in the m6809-7.6 branch.

Now fire up XRoar with the -gdb option, and try:

$ m6809-gdb
GNU gdb (GDB)
(gdb) target remote localhost:65520

Windows note: looks like localhost doesn't necessarily resolve by default on Windows. Try substituting and add -gdb-ip as an extra option to XRoar.

Using DDD

At the time of writing, DDD requires a patch to work with newer versions of GDB. The Debian build contains the patch, but for your convenience, I've copied it here.

Once built, DDD can be started using m6809-gdb as its debugger, and told to connect to XRoar on its default port:

$ ddd --debugger m6809-gdb --eval-command="target remote localhost:65520"

Please consult the documentation for GDB and DDD for more information on using these tools.

Updated 14 Jun 2020