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