From owner-freebsd-hackers Tue Nov 9 15: 9:25 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (Postfix) with ESMTP id BC682150CE for ; Tue, 9 Nov 1999 15:09:19 -0800 (PST) (envelope-from julian@whistle.com) Received: from current1.whiste.com (current1.whistle.com [207.76.205.22]) by alpo.whistle.com (8.9.1a/8.9.1) with ESMTP id PAA29239; Tue, 9 Nov 1999 15:09:07 -0800 (PST) Date: Tue, 9 Nov 1999 15:09:06 -0800 (PST) From: Julian Elischer To: Greg Lehey Cc: Archie Cobbs , Zhihui Zhang , freebsd-hackers@FreeBSD.ORG Subject: Re: How to use gdb to catch a panic In-Reply-To: <19991109174526.14194@mojave.sitaranetworks.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 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 grog@lemis.com for PGP public key > See complete headers for address and phone numbers > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message