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