Subject: Re: kernel debugger
To: Steven Grunza <steven_grunza@ieee.org>
From: Nathan J. Williams <nathanw@MIT.EDU>
List: port-i386
Date: 03/14/2000 15:35:50
Steven Grunza <steven_grunza@ieee.org> writes:

> Of course, if there is something mapped to address 0, this won't work.  Is
> there a better way to call ddb?

Yes. There's a function, Debugger(), which will invoke ddb. The right
way to use it when you need to drop into the debugger is something
like:

#include "opt_ddb.h"

...

#ifdef MYDEVICE_DEBUG
#ifdef DDB
        Debugger();
#endif
#endif

You could also break into ddb early and set a breakpoint before your
code runs.

If this is a "can't happen" kind of condition, rather than a temporary
debugging aid, you should probably call panic() instead, since that
will work whether or not DDB is compiled in, and will cause the right
thing to happen either way (panic/crash dump for post-mortem, or
dropping into the debugger).

        - Nathan