From owner-cvs-src@FreeBSD.ORG Tue Jan 29 23:55:50 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 1E60716A41A; Tue, 29 Jan 2008 23:55:50 +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 61EEE13C448; Tue, 29 Jan 2008 23:55:48 +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 230157771-1834499 for multiple; Tue, 29 Jan 2008 18:54:23 -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 m0TNtfgN099803; Tue, 29 Jan 2008 18:55:42 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: src-committers@freebsd.org Date: Tue, 29 Jan 2008 18:55:37 -0500 User-Agent: KMail/1.9.7 References: <200801292344.m0TNiYrd039016@repoman.freebsd.org> In-Reply-To: <200801292344.m0TNiYrd039016@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200801291855.37308.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]); Tue, 29 Jan 2008 18:55:42 -0500 (EST) X-Virus-Scanned: ClamAV 0.91.2/5600/Tue Jan 29 16:52:23 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, cvs-all@freebsd.org Subject: Re: cvs commit: src/gnu/usr.bin/gdb/kgdb kgdb.h kld.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: Tue, 29 Jan 2008 23:55:50 -0000 On Tuesday 29 January 2008 06:44:34 pm John Baldwin wrote: > jhb 2008-01-29 23:44:34 UTC >=20 > FreeBSD src repository >=20 > Modified files: > gnu/usr.bin/gdb/kgdb kgdb.h kld.c trgt.c=20 > Log: > - Rework the kld support to hook into GDB's shared library support. > kgdb(8) now treats kld's as shared libraries relative to the kernel > "binary". Thus, you can use 'info sharedlibrary' to list the kld's > along with 'sharedlibrary' and 'nosharedlibrary' to manage symbol > loading and unloading. Note that there isn't an easy way to force GDB > to use a specific path for a shared library. However, you can use > 'nosharedlibrary' to unload all the klds and then use 'sharedlibrary' > to load specific klds where it gets the kld correct and use > 'add-kld' for the kld's where the default open behavior doesn't work. > klds opened via 'sharedlibrary' (and during startup) do have their > sections listed in 'info files'. > - Change the 'add-kld' command to use filename completion to complete i= ts > argument. So now what it looks like: > sudo ./kgdb -q [GDB will not be able to debug user-mode threads: /usr/lib/libthread_db.so:= =20 Undefined symbol "ps_pglobal_lookup"] Reading symbols from /boot/kernel/iwi_bss.ko...Reading symbols=20 from /boot/kernel/iwi_bss.ko.symbols...done. done. Loaded symbols for /boot/kernel/iwi_bss.ko Reading symbols from /boot/kernel/logo_saver.ko...Reading symbols=20 from /boot/kernel/logo_saver.ko.symbols...done. done. Loaded symbols for /boot/kernel/logo_saver.ko #0 sched_switch (td=3D0xc08fdb90, newtd=3DVariable "newtd" is not availabl= e. ) at /usr/src/sys/kern/sched_ule.c:1905 1905 cpuid =3D PCPU_GET(cpuid); (kgdb) info sharedlibrary =46rom To Syms Read Shared Object Library 0xc3e875a0 0xc3e8763b Yes /boot/kernel/iwi_bss.ko 0xc41077a0 0xc4107c28 Yes /boot/kernel/logo_saver.ko And for a crash dump: > sudo ./kgdb -q -c /usr/crash/vmcore.10 /boot/kernel/kernel [GDB will not be able to debug user-mode threads: /usr/lib/libthread_db.so:= =20 Undefined symbol "ps_pglobal_lookup"] Reading symbols from /boot/modules/crash.ko...Reading symbols=20 from /boot/modules/crash.ko.symbols...done. done. Loaded symbols for /boot/modules/crash.ko #0 doadump () at pcpu.h:195 195 pcpu.h: No such file or directory. in pcpu.h (kgdb) info sharedlibrary =46rom To Syms Read Shared Object Library 0xc3d416f0 0xc3d4364e Yes /boot/modules/crash.ko (kgdb) info files Symbols from "/boot/kernel/kernel". kernel core files: `/boot/kernel/kernel', file type elf32-i386-freebsd. 0xc04000d4 - 0xc04000e1 is .interp 0xc04000e4 - 0xc0410330 is .hash 0xc0410330 - 0xc0430b30 is .dynsym 0xc0430b30 - 0xc0451348 is .dynstr 0xc0451350 - 0xc0826880 is .text 0xc0826880 - 0xc084207c is .rodata 0xc084207c - 0xc08980ec is .rodata.str1.1 0xc08980ec - 0xc0899204 is set_sysctl_set 0xc0899204 - 0xc0899e20 is set_sysinit_set 0xc0899e20 - 0xc089a2ac is set_sysuninit_set 0xc089a2ac - 0xc089a7ec is set_modmetadata_set =2E.. 0xc089a950 - 0xc089a96c is set_scrndr_set =2D--Type to continue, or q to quit--- 0xc089b980 - 0xc08e702a is .data 0xc08e702c - 0xc08e7038 is .got 0xc08e7038 - 0xc08e70a0 is .dynamic 0xc08e70c0 - 0xc091691c is .bss 0xc3d3f094 - 0xc3d3f318 is .hash in /boot/modules/crash.ko 0xc3d3f318 - 0xc3d3f8d8 is .dynsym in /boot/modules/crash.ko 0xc3d3f8d8 - 0xc3d3fc7e is .dynstr in /boot/modules/crash.ko 0xc3d3fc80 - 0xc3d416f0 is .rel.dyn in /boot/modules/crash.ko 0xc3d416f0 - 0xc3d4364e is .text in /boot/modules/crash.ko 0xc3d4364e - 0xc3d43f4e is .rodata in /boot/modules/crash.ko =2E.. =2D-=20 John Baldwin