Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Nov 2010 16:34:21 -0800
From:      Julian Elischer <julian@freebsd.org>
To:        FreeBSD Current <current@freebsd.org>
Subject:   kgdb and .ko files
Message-ID:  <4CD8970D.6030003@freebsd.org>

next in thread | raw e-mail | index | archive | help
my usual command set for doing .ko debugging issomething like:
%kgdb /sys/amd64/compile/DEBUG/kernel.symbols
(kgdb) target remote pu_serial2:7005
(kgdb) sharedlibrary driver.ko
(kgdb) directory /home/me/branches/blah/obj/

(kgdb) info sharedlibrary
>From                To                  Syms Read   Shared Object Library
0xffffffff81222000  0xffffffff8129dac0  Yes         
home/me/branches/blah/freebsd8-amd64/output/driver.ko

but recently the last line has started returning:

>From                To                  Syms Read   Shared Object Library
                                         Yes         
home/me/branches/blah/freebsd8-amd64/output/driver.ko

Now I can guess that the problem might be something to do with readinf 
symbols as our
method of generating the .ko changed a while back but when I look at 
it I do see:

awk -f /sys/conf/kmod_syms.awk driver.ko.debug  export_syms | xargs 
-J% objcopy %driver.ko.debug
objcopy --only-keep-debug driver.ko.debug driver.ko.symbols
objcopy --strip-debug --add-gnu-debuglink=driver.ko.symbols 
driver.ko.debug driver.ko

so theoretically the plain driver.ko should result in (k)gdb looking 
up the symbol file driver.ko.symbols
which should have all the symbol information needed for debugging..
or am I misreading this?

doesn't seem to work but it does seem to improve if I link the .ko 
file to the symbols file..

this is in 8.1 rather than -current but I can't test -current.










Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4CD8970D.6030003>