xref: /freebsd/tools/debugscripts/README (revision cf02bf2407cb217c99cc82f78b7a2e7f0703c9ee)
10fa02ea5SGreg Lehey$FreeBSD$
20fa02ea5SGreg Lehey
30fa02ea5SGreg LeheyThis directory contains gdb macros for kernel debugging.  When you
40fa02ea5SGreg Leheybuild a debug kernel, the target "gdbinit" in the kernel Makefile will
50fa02ea5SGreg Leheycreate the correct .gdbinit files in the kernel build directory.  To
60fa02ea5SGreg Leheyperform kernel debugging, you would do:
70fa02ea5SGreg Lehey
80fa02ea5SGreg Lehey  # cd /usr/obj/usr/src/sys/GENERIC  (or name of kernel config)
90fa02ea5SGreg Lehey  # make gdbinit
100fa02ea5SGreg Lehey  # gdb kernel.debug
110fa02ea5SGreg Lehey  This GDB was configured as "i386-undermydesk-freebsd"...
120fa02ea5SGreg Lehey  Ready to go.  Enter 'tr' to connect to remote target
130fa02ea5SGreg Lehey  and 'getsyms' after connection to load kld symbols.
140fa02ea5SGreg Lehey  (kgdb)
150fa02ea5SGreg Lehey
160fa02ea5SGreg Lehey
17cf02bf24SJohn-Mark GurneyThis directory also contains a kgdb script that given a crash dump number
18cf02bf24SJohn-Mark Gurneyautomaticly extract the path to the kernel source, run gdb to extract
19cf02bf24SJohn-Mark Gurneyinformation about kernel modules loaded, and then rerun gdb loading the
20cf02bf24SJohn-Mark Gurneynecessary symbols for the modules.  You need to make sure you build the
21cf02bf24SJohn-Mark Gurneymodules w/ debugging symbols seperately to get things to work.
22