[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: debuging mach

If you want to use gnumach's built-in debugger (aka ddb and sometimes
called kdb), then the thing to do is start the kernel with the -d switch
(in a kernel compiled with --enable-kdb).  Then you should get the debugger
prompt immediately on boot.  You can then set breakpoints whereever you
like to stop and examine the kernel.  Note that this is a primitive
debugger, not a source-level debugger, and in fact we don't even support
getting an ELF symbol table into the kernel debugger so you don't get any
symbols at all.

If you use oskit-mach, it supports (that is, the oskit supports) using gdb
over a serial line from another machine.  That is by far the best way to
debug the kernel.  You use gdb and have nice source-level debugging and
most everything you are used to from using gdb on user programs.  If you
can do this (i.e. have two machines and a serial cable) and want to, then
you should get started first by debugging some oskit example kernels using
gdb over your serial line.  There is a debian package of oskit that you can
easily install to build your kernels, though I would recommend compiling it
yourself from source with -g.  You should refer to
http://www.cs.utah.edu/flux/oskit/ for information about the oskit and how
to set things up to use gdb over a serial line (or at least where to ask
for advice, which is not here).  Once that is all working for you and you
have gotten a feel for using gdb with an oskit kernel, just build
oskit-mach with -g and you can debug it like other oskit kernels.

Reply to: