From owner-cvs-all@FreeBSD.ORG Wed Jan 23 22:10:04 2008 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 701BE16A468; Wed, 23 Jan 2008 22:10:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id 0F6F913C467; Wed, 23 Jan 2008 22:10:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8s) with ESMTP id 229508076-1834499 for multiple; Wed, 23 Jan 2008 17:11:10 -0500 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m0NM9vtg021630; Wed, 23 Jan 2008 17:10:00 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Yar Tikhiy Date: Wed, 23 Jan 2008 15:46:59 -0500 User-Agent: KMail/1.9.7 References: <200801172143.m0HLhCm8016953@repoman.freebsd.org> <200801171652.31546.jhb@freebsd.org> <20080123173307.GA27907@freefall.freebsd.org> In-Reply-To: <20080123173307.GA27907@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801231546.59937.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 23 Jan 2008 17:10:01 -0500 (EST) X-Virus-Scanned: ClamAV 0.91.2/5532/Wed Jan 23 16:08:36 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/gnu/usr.bin/gdb/kgdb kgdb.h main.c trgt.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2008 22:10:04 -0000 On Wednesday 23 January 2008 12:33:07 pm Yar Tikhiy wrote: > On Thu, Jan 17, 2008 at 04:52:30PM -0500, John Baldwin wrote: > > On Thursday 17 January 2008 04:43:12 pm John Baldwin wrote: > > > jhb 2008-01-17 21:43:12 UTC > > > > > > FreeBSD src repository > > > > > > Modified files: > > > gnu/usr.bin/gdb/kgdb kgdb.h main.c trgt.c > > > Log: > > > Add a new 'add-kld ' command to kgdb to make it easier to analyze > > > crash dumps with kernel modules. The command is basically a wrapper > > > around add-symbol-file except that it uses the kernel linker data > > > structures and the ELF section headers of the kld to calculate the > > > section addresses add-symbol-file needs. > > > > Forgot to say: > > > > Tested on: i386, amd64 > > > > A sample run on i386: > > > > > sudo ./kgdb -c /usr/crash/vmcore.10 /boot/kernel/kernel > > ... > > crash: blow the kernel stack on purpose > > > > Fatal double fault: > > eip = 0xc05c6220 > > esp = 0xe61b0000 > > ebp = 0xe61b0018 > > panic: double fault > > KDB: enter: panic > > ... > > (kgdb) where > > #0 doadump () at pcpu.h:195 > > #1 0xc05d399c in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:417 > > #2 0xc05d3c0a in panic (fmt=Variable "fmt" is not available. > > ) at /usr/src/sys/kern/kern_shutdown.c:571 > > #3 0xc08115d9 in dblfault_handler () at /usr/src/sys/i386/i386/trap.c:927 > > #4 0xc05c6220 in mtx_pool_setup_dynamic () > > #5 0xc065e125 in arc4rand (ptr=0xe61b0168, len=4, reseed=0) > > at /usr/src/sys/libkern/arc4random.c:142 > > #6 0xc065e171 in arc4random () at /usr/src/sys/libkern/arc4random.c:150 > > #7 0xc3d43402 in ?? () > > #8 0xb15ac28c in ?? () > > #9 0x793b5626 in ?? () > > #10 0xe61b018c in ?? () > > #11 0xc3d43410 in ?? () > > #12 0xbc8e58bf in ?? () > > ... > > (kgdb) add-kld crash.ko > > add symbol table from file "/boot/modules/crash.ko.symbols" at > > .text_addr = 0xc3d416f0 > > .data_addr = 0xc3d44000 > > .bss_addr = 0xc3d44254 > > .rodata_addr = 0xc3d4364e > > Reading symbols from /boot/modules/crash.ko.symbols...done. > > Thank you! > > By the way, if there are a lot of modules to load, using asf(8) > might be a little easier: one needs to run asf once and then he > can source its output (written to .asf by default) into the kgdb > session. Just a little advertisment so that my work on asf(8) > doesn't fall into oblivion. :-) > > OTOH, I can imagine `add-all-klds' command for kgdb implemented in > a similar vein since there is a full list of loaded modules in the > core image. Actually, that is my next step is to make the kgdb auto-load all klds it can find on startup. asf(8) does work, but I find it a bit more work to have to use an external utility to do it, and potentially more confusing for users. -- John Baldwin