Subject: Re: Status of kernel debugging (with gdb) on the sparc?
To: None <deraadt@sun-lamp.CS.Berkeley.EDU, cgd@alpha.bostic.com>
From: Paul Kranenburg <pk@cs.few.eur.nl>
List: port-sparc
Date: 09/12/1994 09:32:32
> How well does 'gdb -k' work on the sparc kernel, and in what capacities?
> Does it work over serial line?  ethernet?
> 

`gdb -k' is capable of reading the kernel's symbol table and of using that
info to inspect (and sometimes set) kernel variables. gdb uses libkvm for
this, so the core file specified can be /dev/mem as well, allowing you to
inspect and tune a live kernel.

Note that this is different from debugging kernels over serial lines or any
other remote connection. I have never tried to do this anyway. The kernel
options KGDB, KGDBDEV pertain to this mode of debugging but /not/ to the
`gdb -k' mode above.

Of cause, you'll need to compile with `-g' to get maximum comfort.


On DDB:

The sparc machine dependent ddb routines are not complete: you cannot set
breakpoints or disassemble pieces of code. You can get stack traces and
inspect variables. `option DDB' is mandatory as it is in all ports.

Getting the symbol table loaded is a problem if you're using Sun's bootstrap
programs (which btw, is the only way to load a kernel over the net). You could
use the old `dbsym' to load the symbols into the kernel image.

-pk