xref: /freebsd/tools/debugscripts/README (revision 6bfca4dcab07dad45a805879d954876b353c0810)
1
2This directory contains gdb macros for kernel debugging.  When you
3build a debug kernel, the target "gdbinit" in the kernel Makefile will
4create the correct .gdbinit files in the kernel build directory.  To
5perform kernel debugging, you would do:
6
7  # cd /usr/obj/usr/src/sys/GENERIC  (or name of kernel config)
8  # make gdbinit
9  # gdb kernel.debug
10  This GDB was configured as "i386-undermydesk-freebsd"...
11  Ready to go.  Enter 'tr' to connect to remote target
12  and 'getsyms' after connection to load kld symbols.
13  (kgdb)
14
15
16This directory also contains a kgdb script that, given a crash dump number,
17automatically extracts the path to the kernel source, runs gdb to extract
18information about kernel modules loaded, and then reruns gdb loading the
19necessary symbols for the modules.  You need to make sure you build the
20modules w/ debugging symbols separately to get things to work.
21