From owner-freebsd-hackers Mon Aug 13 13:35:26 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from news.IAEhv.nl (news.iae.nl [212.61.26.37]) by hub.freebsd.org (Postfix) with ESMTP id 024F637B401 for ; Mon, 13 Aug 2001 13:35:21 -0700 (PDT) (envelope-from volf@oasis.IAEhv.nl) Received: (from uucp@localhost) by news.IAEhv.nl (8.9.1/8.9.1) with IAEhv.nl id WAA02895; Mon, 13 Aug 2001 22:35:18 +0200 (MET DST) Received: by drawbridge.oasis.IAEhv.nl (Postfix, from userid 226) id C9E2F3E07; Mon, 13 Aug 2001 22:30:47 +0200 (CEST) Subject: Re: how to debug a kld module? In-Reply-To: To: freebsd-hackers@freebsd.org Date: Mon, 13 Aug 2001 22:30:47 +0200 (CEST) Cc: Rolf Neugebauer X-Mailer: ELM [version 2.4ME+ PL92 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Message-Id: <20010813203047.C9E2F3E07@drawbridge.oasis.IAEhv.nl> From: volf@oasis.IAEhv.nl (Frank Volf) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Rolf Neugebauer wrote: > > My system panics with a page fault in one of my kernel loadable modules. I > > want to debug this, but I can't find a way to load that module and its > > symbol table into gdb. > > > > The steps that I have taken are > > > > gdb -k /sys/compile/DRAWBRIDGE/kernel.debug vmcore.11 > > > > which gives me a normal kenel with debug symbols that I can debug? But, how > > can I load the offending kld module symbol table as well? Or can I only > > properly debug this, when I compile the module into the kernel? > > Try following the steps in the developers handbook: > > http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kerneldebug.html > > In particular the section 11.6 Debugging Loadable Modules Using GDB: > http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/x4290.html Thanks, this is very usefull information, so I feel rather stupid to ask the next question. How exactly do I walk the linker_files structure as described in the developers handbook: gdb -k /sys/compile/DRAWBRIDGE/kernel.debug vmcore.13 GNU gdb 4.18 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-unknown-freebsd"... IdlePTD 3633152 initial pcb at 2e6600 panicstr: page fault .... (kgdb) print linker_files $1 = -1067722752 (kgdb) print *linker_files $2 = 5 (kgdb) print linker_files->tqh_first Attempt to extract a component of a value that is not a structure pointer. (kgdb) whatis linker_files type = What am I doing wrong? Frank To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message