From owner-freebsd-hackers Tue Nov 9 14:28:47 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from yana.lemis.com (yana.lemis.com [192.109.197.140]) by hub.freebsd.org (Postfix) with ESMTP id 9D24614C58 for ; Tue, 9 Nov 1999 14:28:27 -0800 (PST) (envelope-from grog@mojave.sitaranetworks.com) Received: from mojave.sitaranetworks.com ([199.103.141.157]) by yana.lemis.com (8.8.8/8.8.8) with ESMTP id IAA11702; Wed, 10 Nov 1999 08:58:19 +1030 (CST) (envelope-from grog@mojave.sitaranetworks.com) Message-ID: <19991109172745.27205@mojave.sitaranetworks.com> Date: Tue, 9 Nov 1999 17:27:45 -0500 From: Greg Lehey To: Zhihui Zhang , archie@whistle.com Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: How to use gdb to catch a panic Reply-To: Greg Lehey References: <19991109164507.31840@mojave.sitaranetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: ; from Zhihui Zhang on Tue, Nov 09, 1999 at 04:04:34PM -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tuesday, 9 November 1999 at 16:04:34 -0500, Zhihui Zhang wrote: > On Tue, 9 Nov 1999, Greg Lehey wrote: >> On Tuesday, 9 November 1999 at 13:36:56 -0800, Archie Cobbs wrote: >>> Zhihui Zhang writes: >>>> Thanks for your reply. What confuses me is that when I use commands "gdb" >>>> (enter remote protocol mode) and "step" on the target machine, the >>>> debugging machine takes control (it executes "target remote /dev/cuaa1"). >>>> In this case, how can I run anything on the target machine to trigger a >>>> panic? >>> >>> I'm not sure if this answers your question, but the command >>> >>> sysctl -w debug.cebugger=1 >>> >>> will cause the kernel to stop and return your gdb prompt. >>> Then you could call the function panic() directly if you wanted. >> >> Take a look at /usr/src/sys/modules/vinum/.gdbinit.kernel. There's >> some almost undocumented stuff in there, including a macro called >> ddb. Call it from gdb and it'll switch back to ddb. > > Thanks! I will certainly look into them. In the same time, I add a > sysctl variable and let my program calls Debugger("some string") if that > sysctl variable is true. I don't understand what that's useful for. > It seems working. I hope someone will write a hacker's book. I'm intending to write something on the subject, but don't count on it soon. 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