From owner-cvs-src@FreeBSD.ORG Thu Jan 17 21:43:12 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F10B616A417; Thu, 17 Jan 2008 21:43:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1157C13C478; Thu, 17 Jan 2008 21:43:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m0HLhC0W016954; Thu, 17 Jan 2008 21:43:12 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from jhb@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m0HLhCm8016953; Thu, 17 Jan 2008 21:43:12 GMT (envelope-from jhb) Message-Id: <200801172143.m0HLhCm8016953@repoman.freebsd.org> From: John Baldwin Date: Thu, 17 Jan 2008 21:43:12 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/gnu/usr.bin/gdb/kgdb kgdb.h main.c trgt.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jan 2008 21:43:13 -0000 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. The 'kld' parameter may either be an absolute path or a relative path. kgdb looks for the kld in several locations checking for variants with ".symbols" or ".debug" suffixes in each location. The first location it tries is just opening the specified path (this handles absolute paths and looks for the kld relative to the current directory otherwise). Next it tries to find the module in the same directory of the kernel image being used. If that fails it extracts the kern.module_path from the kernel being debugged and looks in each of those paths. The upshot is that for the common cases of debugging /boot/kernel/kernel where the module is in either /boot/kernel or /boot/modules one can merely do 'add-kld foo.ko'. MFC after: 1 week Revision Changes Path 1.7 +2 -0 src/gnu/usr.bin/gdb/kgdb/kgdb.h 1.12 +2 -2 src/gnu/usr.bin/gdb/kgdb/main.c 1.6 +271 -0 src/gnu/usr.bin/gdb/kgdb/trgt.c