On Tue, 9 Nov 1999, Greg Lehey wrote:

> 
> On my non-Whistle -CURRENT machine I have:
> 
>   $  sysctl -a | grep debugger
>   debug.debugger_on_panic: 1
> 
> Is this what you're talking about?  Otherwise, what's the difference?

This allows the USER level code to trap to the kernel debugger,
and at the same time specify whether it should run the dgb robot, or the
ddb debugger.

e.g. when a daemon notices a particular symptom that indicates that we
want to look at kernel state. We tend to use it in a similar way to 
the keyboard's <ctl><alt><esc> in order to drop a remote machine (with
serial console) to the gdb debugger. We may not be able to use the
debugger-on-break case, and in any case that can't be done from the
machine itself.

The code is simplicity itself..


#if DDB
static int debugger_type;

static int
sysctl_debug_debugger SYSCTL_HANDLER_ARGS
{
        int     odb;
        int     error;

        odb = debugger_type;
        error  = sysctl_handle_int(oidp,&debugger_type, 0, req);

        if ((error == 0) && req->newptr) {
                if (debugger_type == 0)
                        boothowto &= ~RB_GDB;
                else
                        boothowto |= RB_GDB;
                Debugger("sysctl asked us to enter");
        }
        return (error);
}
SYSCTL_PROC(_debug, OID_AUTO, debugger, CTLTYPE_INT|CTLFLAG_RW,
        0, sizeof debugger_type, sysctl_debug_debugger, "I", "");
#endif

> 
> Greg
> --
> Finger [EMAIL PROTECTED] for PGP public key
> See complete headers for address and phone numbers
> 



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to