Name Date Size #Lines LOC

..--

README.txtH A D27-Oct-20251.2 KiB2721

acttrace.pyH A D27-Oct-20251.2 KiB4727

freebsd.pyH A D03-Oct-20251.8 KiB7652

pcpu.pyH A D27-Oct-20252.9 KiB7857

selftest.pyH A D03-Oct-2025807 3220

selftest.shH A D03-Oct-2025484 2413

vnet.pyH A D27-Oct-20254 KiB10165

README.txt

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
11When improving these scripts, you can use the "kgdb-reload" command to reload
12them from /usr/lib/debug/boot/kernel/gdb/*.
13
14To provide some rudimentary testing, selftest.py tries to exercise all of the
15commands and functions defined here.  To use it, run selftest.sh to panic the
16system.  Then, create a kernel dump or attach to the panicked kernel, and invoke
17the script with "python import selftest" in (k)gdb.
18
19Commands:
20acttrace	Display a backtrace for all on-CPU threads
21kgdb-reload     Reload all gdb modules, useful when developing the modules
22                themselves.
23
24Functions:
25$PCPU(<field>[, <cpuid>])	Display the value of a PCPU/DPCPU field
26$V(<variable>[, <vnet>])	Display the value of a VNET variable
27