DDB(8)
π DDB(8) β the ddb girlie's guide to poking the kernel debugger β¨
ok so real talk: ddb is a lil system management utility (the man page calls it a "System Manager's Manual" situation) that lets u tweak certain aspects of the ddb(4) kernel debugger from user space π β specifically the stuff that isn't set at compile-time and isn't easy to do through sysctl(8) MIB entries. no cap, it's the missing piece π«Ά
πΈ SYNOPSIS πΈ
ddb capture [-M -core] [-N -system] print
ddb capture [-M -core] [-N -system] status
ddb script scriptname
ddb script scriptname=script
ddb scripts
ddb unscript scriptname
ddb pathname
β¨ DESCRIPTION β¨
okay so ddb configures certain aspects of the ddb(4) kernel debugger from user space β the ones that are not configured at compile-time, and not easily configured via sysctl(8) MIB entries. iconic behavior honestly π
And to make ur life easier π commands can be put in a file, and that file gets processed using ddb β that's the last line of the synopsis up there, ddb pathname. An absolute pathname must be used, ok? don't be out here with relative paths bestie π
The file gets read line by line and applied as arguments to the ddb utility. Whitespace at the beginning of lines is ignored π β and so are lines where the first non-whitespace character is # (comments, we love her π
).
π¦ OUTPUT CAPTURE π¦
The ddb utility can be used to extract the contents of the ddb(4) output capture buffer β either of the current live kernel π₯ or from the crash dump of a kernel on disk π. The following debugger commands are available from the command line:
capture [-M core] [-N system] printβ print the current contents of theddb(4)output capture buffer βcapture [-M core] [-N system] statusβ print the current status of theddb(4)output capture buffer π
π SCRIPTING π
The ddb utility can also be used to configure aspects of ddb(4) scripting from user space β and the scripting support is described in more detail over in ddb(4) iykyk π. Each of the debugger commands is available from the command line:
script scriptnameβ print the script named scriptname π§script scriptname=scriptβ define a script named scriptname. And listen π: since so many scripts contain characters that the shell interprets in special ways, it is advisable to enclose script in quotes β fr fr, save urself the pain πscriptsβ list currently defined scripts πunscript scriptnameβ delete the script named scriptname π
π EXIT STATUS π
The ddb utility exits 0 on success, and >0 if an error occurs. that's it, that's the vibe check πΈ
β EXAMPLES β
The following example defines a script that will execute when the kernel debugger is entered as a result of a break signal π₯:
ddb script kdb.enter.break="show pcpu; bt"
The following example will delete the script π :
ddb unscript kdb.enter.break
For further examples, see the ddb(4) and textdump(4) manual pages π«Ά
π SEE ALSO π
ddb(4), mac_ddb(4), textdump(4), sysctl(8) π
π HISTORY π
The ddb utility first appeared in FreeBSD 7.1 β³ β a whole era.
π AUTHORS π
Robert N M Watson π«Ά
π BUGS π
ngl, ideally ddb would not exist at all, because all pertinent aspects of ddb(4) could be configured directly via sysctl(8) π. that's the actual documented take, and honestly? she said what she said.
and that's the whole page bestie!! this lil Debian build is datedDecember 24, 2008and the manual isDDB(8)β go forth and debug, mwah πβ¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2007-2008 Robert N. M. Watson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms