From owner-freebsd-hackers Thu Aug 19 17: 6:32 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (Postfix) with ESMTP id 53EA614E1F for ; Thu, 19 Aug 1999 17:06:22 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id JAA25555; Fri, 20 Aug 1999 09:35:32 +0930 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.3/8.9.0) id JAA61385; Fri, 20 Aug 1999 09:35:30 +0930 (CST) Date: Fri, 20 Aug 1999 09:35:30 +0930 From: Greg Lehey To: Zhihui Zhang Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Kernel debugging questions Message-ID: <19990820093530.G14964@freebie.lemis.com> References: <199908191934.MAA07552@dingo.cdrom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: ; from Zhihui Zhang on Thu, Aug 19, 1999 at 12:15:51PM -0400 WWW-Home-Page: http://www.lemis.com/~grog X-PGP-Fingerprint: 6B 7B C3 8C 61 CD 54 AF 13 24 52 F8 6D A4 95 EF Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thursday, 19 August 1999 at 12:15:51 -0400, Zhihui Zhang wrote: > > I am using FreeBSD 4.0 and have two questions on kernel debugging: > > (2) After bootup, I try the following to debug the live system (after > reading some pages of the book "Panic! Unix system crash dump analysis"): > > now4# gdb -k /kernel.debug /dev/mem > (kgdb) run > Starting program: /kernel.debug > > Program terminated with signal SIGABRT, Aborted. > The program no longer exists. > You can't do that without a process to debug. > > Is there something wrong? Yes. You shouldn't try to run the kernel. > I did the same thing with the postmortem coredump files and got > similar messages. Maybe I am using gdb in a wrong way. You can't control the execution of the kernel, you can just look at the way things are. With the core dump, you at least have the advantage that things won't change while you look at them; you can't even do that with /dev/mem. The other alternative is remote serial debugging, where you *can* influence the execution of the kernel, for example by setting breakpoints. But remember that the kernel is already running when you attach to it, so you don't say 'run', you say 'c[ontinue]'. Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message