From owner-freebsd-hackers Tue Nov 9 9: 2:13 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from bingnet2.cc.binghamton.edu (bingnet2.cc.binghamton.edu [128.226.1.18]) by hub.freebsd.org (Postfix) with ESMTP id 3BD511503B for ; Tue, 9 Nov 1999 09:02:08 -0800 (PST) (envelope-from zzhang@cs.binghamton.edu) Received: from sol.cs.binghamton.edu (cs1-gw.cs.binghamton.edu [128.226.171.72]) by bingnet2.cc.binghamton.edu (8.9.3/8.9.3) with SMTP id MAA04006; Tue, 9 Nov 1999 12:02:01 -0500 (EST) Date: Tue, 9 Nov 1999 10:49:41 -0500 (EST) From: Zhihui Zhang To: Greg Lehey Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: How to use gdb to catch a panic In-Reply-To: <19991109103938.63558@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 Tuesday, 9 November 1999 at 8:52:58 -0500, Zhihui Zhang wrote: > > > > I have set up an environment of remote serial debugging on FreeBSD > > 3.3-Release. I have a program that whenever it runs the kernel panics. > > Is there any way I can use remote serial debugging to trace this panic > > process instead of examining a dead kernel (i.e., coredump)? > > Yes. > > > Or, is there any way I can use to drop the debugged kernel to debugger > > mode whenever it runs a certain piece of code? > > Yes. That's what breakpoints are for. If you set a breakpoint on > panic, you'll go into the debugger. But you don't need that, since > you go into the debugger on panic anyway. > > If you're expecting a breakpoint or panic, and you want to do it in > gdb as opposed to ddb, set gdb mode ahead of time. This is also > useful for debugging ddb :-) 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? How to set gdb mode ahead of time? -Zhihui To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message