Subject: How do I run a remote kgdb session for BSD/OS?
Date: 09/13/97
To run remote kgdb you need to have two machines running BSD/OS: The machine you are going to debug (remote) and the machine you will debug from (host). You should have a serial cable attached between the two machines on unused serial ports. Assuming you are using tty01 on the remote machine then you should build your kernel with the following in the config file:

options       DEBUG="-g"              # build bsd.gdb with full symbol table
options       KGDB                    # cross-system kernel debugger
options       "KGDBRATE=9600"         # remote debugging baud rate
options       "KGDBDEV=0x800001"      # kgdb device, tty01

It is best to build the kernel on the host machine and copy the resulting bsd to the remote machine. Once running with the new bsd you can start up gdb on the host machine:

# gdb -k bsd.gdb

and the to attach you would us a command similar to:

(gdb) target remote /dev/tty01

You might also find

(gdb) set remote-text-refs off

to be useful. Finally, use:

(gdb) cont

to allow the remote machine to continue to run. Use <CTRL-C> to halt the remote machine and get back into gdb. You can use break points, do back traces, etc. If the remote machine panics you should find yourself back in gdb.

If you do panic, you can use the command:

(gdb) jump boot

to reboot in most cases. After doing this, if you want to kill gdb you will need to suspend it with <CTRL-Z> and then kill -9 the process.