From owner-freebsd-alpha Wed Jun 6 9:57:23 2001 Delivered-To: freebsd-alpha@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id BFAC237B408; Wed, 6 Jun 2001 09:57:16 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.3/8.11.2) with ESMTP id f56Gv7108110; Wed, 6 Jun 2001 09:57:07 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20010606074352.B96129@dragon.nuxi.com> Date: Wed, 06 Jun 2001 09:57:10 -0700 (PDT) From: John Baldwin To: "David O'Brien" Subject: Re: -current kernel still considered dangerous Cc: Freebsd-alpha@FreeBSD.org, Andrew Gallatin , Matthew Jacob Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 06-Jun-01 David O'Brien wrote: > On Wed, Jun 06, 2001 at 07:36:48AM -0700, Matthew Jacob wrote: >> Unlike Solaris, modules are not essential to run FreeBSD. I think debugging >> this by fixing 'debugging modules' is at best a 3rd order priority. > > I thought many of the device driver folks perfer to develop via modules. > How do they debug things? Printf() is it? KTR is a nice printf in disguise. :) You can debug modules, but it isn't very easy to do so. Look at grog's gdb scripts in /sys/modules/vinum. Specifically, look at .gdbinit.vinum.paths and the asf function. It basically walks the list of linker files looking for the first file whose name starts with a 'v'. Then it does an objdump on the vinum module to extract the start of the .text section. It uses this to create a temporary file with a add-symbol-file command that loads the debug vinum module and adds the start address from the linker file entry in the kernel to the .text offset to get the final offset of the symbols. Then it sources said file. Fun. :-P Basically, you use 'add-symbol-file /modules/foo.ko some_address', where some_address = offset of .text in the module + address file is loaded at in the kernel. HTH. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message