xref: /freebsd/sys/tools/gdb/README.txt (revision ea675a43f09ba569adf1dd17b4f1ced970e48de4)
1This directory contains Python scripts that can be loaded by GDB to help debug
2FreeBSD kernel crashes.
3
4Add new commands and functions in their own files.  Functions with general
5utility should be added to freebsd.py.  sys/tools/kernel-gdb.py is installed
6into the kernel debug directory (typically /usr/lib/debug/boot/kernel).  It will
7be automatically loaded by kgdb when opening a vmcore, so if you add new GDB
8commands or functions, that script should be updated to import them, and you
9should document them here.
10
11To provide some rudimentary testing, selftest.py tries to exercise all of the
12commands and functions defined here.  To use it, run selftest.sh to panic the
13system.  Then, create a kernel dump or attach to the panicked kernel, and invoke
14the script with "python import selftest" in (k)gdb.
15
16Commands:
17acttrace	Display a backtrace for all on-CPU threads
18
19Functions:
20$PCPU(<field>[, <cpuid>])	Display the value of a PCPU/DPCPU field
21$V(<variable>[, <vnet>])	Display the value of a VNET variable
22