kgdb can't debug loadable model,need Experts

huoyingyangjie huoyingyangjie at 163.com
Wed Aug 27 12:33:41 UTC 2014


I use  serial ports to debug zfs.ko between  two virtualboxs.  One is freebsd 8.3, one is freebsd 9.3.

At freebsd8.3 :
i type:
①karas# kldstat
Id Refs Address            Size     Name
 1    9 0xffffffff80100000 eae760   kernel
 3    1 0xffffffff81012000 17a988   zfs.ko
 4    1 0xffffffff8118d000 1fb4     opensolaris.ko
②karas# sysctl debug.kdb.enter=1
debug.kdb.enter: 0
At freebsd9.3:
I type:
①root at yangjie:/usr/kernel/kernel # kgdb -r /dev/cuau0 ./kernel
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...Switching to remote protocol








kdb_enter (why=0xffffffff80a757b2 "sysctl", msg=0xa <Address 0xa out of bounds>) at /usr/src/sys/kern/subr_kdb.c:351
351                     kdb_why = KDB_WHY_UNSET;


(kgdb)
Notice:Now,i can debug kernel,and breakpoint for kernle
②(kgdb) info sharedlibrary
From                To                  Syms Read   Shared Object Library
0xffffffff81012000  0xffffffff810d612a  No          /boot/kernel/zfs.ko
0xffffffff8118d000  0xffffffff8118d9f4  No          /boot/kernel/opensolaris.ko
③(kgdb) sharedlibrary zfs.ko
Reading symbols from /boot/kernel/zfs.ko...Reading symbols from /boot/kernel/zfs.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/zfs.ko
④(kgdb) b zfsdev_ioctl
Note: breakpoint 1 also set at pc 0xffffffff810ba4e0.
Breakpoint 2 at 0xffffffff810ba4e0: file /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c, line 5902.


⑤(kgdb) c
Continuing.
At freebsd8.3:
I run "zpool status"or"zpool create yangjie raidz ad1 ad2 ad3".The results is "kgdb don't stop".I try many times.Don't successed.I don't know why.
Who can help me?










More information about the freebsd-questions mailing list