From owner-cvs-all@FreeBSD.ORG Wed Jan 30 13:53: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 6E5F816A418 for ; Wed, 30 Jan 2008 13:53:04 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by mx1.freebsd.org (Postfix) with ESMTP id DF47313C4EC for ; Wed, 30 Jan 2008 13:53:03 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so265329fgg.35 for ; Wed, 30 Jan 2008 05:53:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=lTt3YxHyTeRWV3nq9Q3yy0jIvb/GcOrIJPEC3X95VRw=; b=yBJ6FAm/QMiybhYLETetuBgSG53pq5J9P0ete+bgNW1vdIncVitcKpaqRAccCKORfpWAfXpSKpLYlr4iKx5vvg6mfHbRtg5wDnB346rOH0EnEqIRsUu4d2fJphAD6i674vqlL1O6vjdT5k1YU/vvyvGsjAuJcO9S2gRGsQuFvXQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=ASyt4nkQFB9vI/72RnFfBCZKvlRVyxCpzKNP1YJ2dAGXZw5rb6Wd/XmgvKixcKsXGfBzmfQehqbJMJzTxOlyksh9WOT48QaRqkrC91bEkbtMnVMukL9uts57NnBuKaqjbmnyDSVWUaUm5zvZ4UHye+oeLr43f+Q5rAlUzKqTtFE= Received: by 10.86.81.14 with SMTP id e14mr685702fgb.42.1201701182609; Wed, 30 Jan 2008 05:53:02 -0800 (PST) Received: by 10.86.28.19 with HTTP; Wed, 30 Jan 2008 05:53:02 -0800 (PST) Message-ID: <3bbf2fe10801300553k612435eer3b89dfb0e1a204e9@mail.gmail.com> Date: Wed, 30 Jan 2008 14:53:02 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "John Baldwin" In-Reply-To: <200801291855.37308.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200801292344.m0TNiYrd039016@repoman.freebsd.org> <200801291855.37308.jhb@freebsd.org> X-Google-Sender-Auth: fa77ccf623404437 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 kld.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, 30 Jan 2008 13:53:04 -0000 2008/1/30, John Baldwin : > On Tuesday 29 January 2008 06:44:34 pm John Baldwin wrote: > > jhb 2008-01-29 23:44:34 UTC > > > > FreeBSD src repository > > > > Modified files: > > gnu/usr.bin/gdb/kgdb kgdb.h kld.c trgt.c > > 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 its > > 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: > Undefined symbol "ps_pglobal_lookup"] > Reading symbols from /boot/kernel/iwi_bss.ko...Reading symbols > 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 > from /boot/kernel/logo_saver.ko.symbols...done. > done. > Loaded symbols for /boot/kernel/logo_saver.ko > #0 sched_switch (td=0xc08fdb90, newtd=Variable "newtd" is not available. > ) at /usr/src/sys/kern/sched_ule.c:1905 > 1905 cpuid = PCPU_GET(cpuid); > (kgdb) info sharedlibrary > From 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: > Undefined symbol "ps_pglobal_lookup"] > Reading symbols from /boot/modules/crash.ko...Reading symbols > 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 > From 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 > ... > 0xc089a950 - 0xc089a96c is set_scrndr_set > ---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 > ... Thanks John, great work! Attilio -- Peace can only be achieved by understanding - A. Einstein