From owner-freebsd-hackers Fri Jan 5 6: 4:41 2001 From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 5 06:04:38 2001 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from anchor-post-34.mail.demon.net (anchor-post-34.mail.demon.net [194.217.242.92]) by hub.freebsd.org (Postfix) with ESMTP id A24F137B400 for ; Fri, 5 Jan 2001 06:04:37 -0800 (PST) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by anchor-post-34.mail.demon.net with esmtp (Exim 2.12 #1) id 14EXTs-000Egu-0Y; Fri, 5 Jan 2001 14:04:32 +0000 Received: from herring (herring [10.0.0.2]) by herring.nlsystems.com (8.11.1/8.8.8) with ESMTP id f05E4Gv01086; Fri, 5 Jan 2001 14:04:16 GMT (envelope-from dfr@nlsystems.com) Date: Fri, 5 Jan 2001 14:04:15 +0000 (GMT) From: Doug Rabson To: Doug White Cc: Zhiui Zhang , Subject: Re: kernel debugging suggestion needed In-Reply-To: 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, 2 Jan 2001, Doug White wrote: > On Tue, 2 Jan 2001, Zhiui Zhang wrote: > > > > > I have written a KLD and am debugging it. The program often hangs after > > runs for a while (I guess it enters into some dead loop). Is there a way > > to attach to the process and somehow find out which code it is executing > > (with remote debugging or ddb)? > > kld debugging is a bit tricky. Take a look at the debugging macros and > bits that Greg Lehey put together for vinum for a starting point. You have > to calculate the appropriate offset to get to the KLD code in gdb. Not anymore. You can use GDB's "sharelibrary" command to read the symbols of all loaded KLDs. You only need to ensure that the exact same pathname works for both loading the KLD on the target machine and for loading the symbols on the machine running GDB. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message