- 论坛徽章:
- 2
|
options GDB was added to 6.x( since 5.x), and we need kgdb to debug the kernel. kgdb and gdb are different, not symbol link. kgdb is a debugger based on gdb.
We use gdb -k to debug the kernel on 4.x.
The kernel conf:
machine i386
cpu I686_CPU
ident RUN
makeoptions DEBUG=-g
options GDB
options DEBUG_MEMGUARD
options DDB
options KDB
options KDB_TRACE
options SCHED_ULE
#options SCHED_4BSD
options PREEMPTION
options INET
options FFS
options NFSCLIENT
options NFS_ROOT
options PROCFS
options PSEUDOFS
options GEOM_GPT
options COMPAT_43
options _KPOSIX_PRIORITY_SCHEDULING
options ADAPTIVE_GIANT
device apic
device eisa
device pci
device atkbdc
device atkbd
device vga
device sc
device pmtimer
device uart
#device sio
device miibus
device lnc
device loop
device random
device ether
device pty
device bpf
Add the next lines to /boot/device.hints
hint.uart.0.at="isa"
hint.uart.0.port="0x3f8"
hint.uart.0.flags="0x80"
hint.uart.0.baud="9660"
Reboot both box.
Start to debug.
kgdb -r /dev/cuaa0 kernel.debug
See /sys/conf/NOTES and /sys/i386/conf/NOTES to get more details.
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/132/showart_125802.html |
|