xref: /freebsd/share/man/man4/ddb.4 (revision 8ccc0d235c226d84112561d453c49904398d085c)
1.\"
2.\" Mach Operating System
3.\" Copyright (c) 1991,1990 Carnegie Mellon University
4.\" Copyright (c) 2007 Robert N. M. Watson
5.\" All Rights Reserved.
6.\"
7.\" Permission to use, copy, modify and distribute this software and its
8.\" documentation is hereby granted, provided that both the copyright
9.\" notice and this permission notice appear in all copies of the
10.\" software, derivative works or modified versions, and any portions
11.\" thereof, and that both notices appear in supporting documentation.
12.\"
13.\" CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
14.\" CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
15.\" ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
16.\"
17.\" Carnegie Mellon requests users of this software to return to
18.\"
19.\"  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
20.\"  School of Computer Science
21.\"  Carnegie Mellon University
22.\"  Pittsburgh PA 15213-3890
23.\"
24.\" any improvements or extensions that they make and grant Carnegie Mellon
25.\" the rights to redistribute these changes.
26.\"
27.Dd October 31, 2025
28.Dt DDB 4
29.Os
30.Sh NAME
31.Nm ddb
32.Nd interactive kernel debugger
33.Sh SYNOPSIS
34In order to enable kernel debugging facilities include:
35.Bd -ragged -offset indent
36.Cd options KDB
37.Cd options DDB
38.Ed
39.Pp
40To prevent activation of the debugger on kernel
41.Xr panic 9 :
42.Bd -ragged -offset indent
43.Cd options KDB_UNATTENDED
44.Ed
45.Pp
46In order to print a stack trace of the current thread on the console
47for a panic:
48.Bd -ragged -offset indent
49.Cd options KDB_TRACE
50.Ed
51.Pp
52To print the numerical value of symbols in addition to the symbolic
53representation, define:
54.Bd -ragged -offset indent
55.Cd options DDB_NUMSYM
56.Ed
57.Pp
58To enable the
59.Xr gdb 4
60backend, so that remote debugging with
61.Xr kgdb 1 Pq Pa ports/devel/gdb
62is possible, include:
63.Bd -ragged -offset indent
64.Cd options GDB
65.Ed
66.Sh DESCRIPTION
67The
68.Nm
69kernel debugger is an interactive debugger with a syntax inspired by
70.Xr gdb 1 Pq Pa ports/devel/gdb .
71If linked into the running kernel,
72it can be invoked locally with the
73.Ql debug
74.Xr keymap 5
75action, usually mapped to Ctrl+Alt+Esc, or by setting the
76.Va debug.kdb.enter
77sysctl to 1.
78The debugger is also invoked on kernel
79.Xr panic 9
80if the
81.Va debug.debugger_on_panic
82.Xr sysctl 8
83MIB variable is set non-zero,
84which is the default
85unless the
86.Dv KDB_UNATTENDED
87option is specified.
88Similarly, if the
89.Va debug.debugger_on_recursive_panic
90variable is set to
91.Dv 1 ,
92then the debugger will be invoked on a recursive kernel panic.
93This variable has a default value of
94.Dv 0 ,
95and has no effect if
96.Va debug.debugger_on_panic
97is already set non-zero.
98.Pp
99The current location is called
100.Va dot .
101The
102.Va dot
103is displayed with
104a hexadecimal format at a prompt.
105The commands
106.Ic examine
107and
108.Ic write
109update
110.Va dot
111to the address of the last line
112examined or the last location modified, and set
113.Va next
114to the address of
115the next location to be examined or changed.
116Other commands do not change
117.Va dot ,
118and set
119.Va next
120to be the same as
121.Va dot .
122.Pp
123The general command syntax is:
124.Ar command Ns Op Li / Ns Ar modifier
125.Oo Ar addr Oc Ns Op , Ns Ar count
126.Pp
127A blank line repeats the previous command from the address
128.Va next
129with
130count 1 and no modifiers.
131Specifying
132.Ar addr
133sets
134.Va dot
135to the address.
136Omitting
137.Ar addr
138uses
139.Va dot .
140A missing
141.Ar count
142is taken
143to be 1 for printing commands or infinity for stack traces.
144A
145.Ar count
146of -1 is equivalent to a missing
147.Ar count .
148Options that are supplied but not supported by the given
149.Ar command
150are usually ignored.
151.Pp
152The
153.Nm
154debugger has a pager feature (like the
155.Xr more 1
156command)
157for the output.
158If an output line exceeds the number set in the
159.Va lines
160variable, it displays
161.Dq Li --More--
162and waits for a response.
163The valid responses for it are:
164.Pp
165.Bl -tag -compact -width ".Li SPC"
166.It Li SPC
167one more page
168.It Li RET
169one more line
170.It Li q
171abort the current command, and return to the command input mode
172.El
173.Pp
174Finally,
175.Nm
176provides a small (currently 10 items) command history, and offers
177simple
178.Nm emacs Ns -style
179command line editing capabilities.
180In addition to
181the
182.Nm emacs
183control keys, the usual ANSI arrow keys may be used to browse through the
184history buffer, and move the cursor within the current line.
185.Sh COMMANDS
186.Ss COMMON DEBUGGER COMMANDS
187.Bl -tag -width indent -compact
188.It Ic help
189Print a short summary of the available commands and command
190abbreviations.
191.Pp
192.It Xo
193.Ic examine Ns Op Li / Ns Cm AISabcdghilmorsuxz ...
194.Oo Ar addr Oc Ns Op , Ns Ar count
195.Xc
196.It Xo
197.Ic x       Ns Op Li / Ns Cm AISabcdghilmorsuxz ...
198.Oo Ar addr Oc Ns Op , Ns Ar count
199.Xc
200Display the addressed locations according to the formats in the modifier.
201Multiple modifier formats display multiple locations.
202If no format is specified, the last format specified for this command
203is used.
204.Pp
205The format characters are:
206.Bl -tag -compact -width indent
207.It Cm b
208look at by bytes (8 bits)
209.It Cm h
210look at by half words (16 bits)
211.It Cm l
212look at by long words (32 bits)
213.It Cm g
214look at by quad words (64 bits)
215.It Cm a
216print the location being displayed
217.It Cm A
218print the location with a line number if possible
219.It Cm x
220display in unsigned hex
221.It Cm z
222display in signed hex
223.It Cm o
224display in unsigned octal
225.It Cm d
226display in signed decimal
227.It Cm u
228display in unsigned decimal
229.It Cm r
230display in current radix, signed
231.It Cm c
232display low 8 bits as a character.
233Non-printing characters are displayed as an octal escape code (e.g.,
234.Ql \e000 ) .
235.It Cm s
236display the null-terminated string at the location.
237Non-printing characters are displayed as octal escapes.
238.It Cm m
239display in unsigned hex with character dump at the end of each line.
240The location is also displayed in hex at the beginning of each line.
241.It Cm i
242display as a disassembled instruction
243.It Cm I
244display as a disassembled instruction with possible alternate formats
245depending on the machine.
246On i386, this selects the alternate format for the instruction decoding
247(16 bits in a 32-bit code segment and vice versa).
248.It Cm S
249display a symbol name for the pointer stored at the address
250.El
251.Pp
252.It Ic xf
253Examine forward:
254execute an
255.Ic examine
256command with the last specified parameters to it
257except that the next address displayed by it is used as the start address.
258.Pp
259.It Ic xb
260Examine backward:
261execute an
262.Ic examine
263command with the last specified parameters to it
264except that the last start address subtracted by the size displayed by it
265is used as the start address.
266.Pp
267.It Ic print Ns Op Li / Ns Cm acdoruxz
268.It Ic p Ns Op Li / Ns Cm acdoruxz
269Print
270.Ar addr Ns s
271according to the modifier character (as described above for
272.Cm examine ) .
273Valid formats are:
274.Cm a , x , z , o , d , u , r ,
275and
276.Cm c .
277If no modifier is specified, the last one specified to it is used.
278The argument
279.Ar addr
280can be a string, in which case it is printed as it is.
281For example:
282.Bd -literal -offset indent
283print/x "eax = " $eax "\enecx = " $ecx "\en"
284.Ed
285.Pp
286will print like:
287.Bd -literal -offset indent
288eax = xxxxxx
289ecx = yyyyyy
290.Ed
291.Pp
292.It Ic pprint Ns Oo Li / Ns Cm d depth Oc Oo Ar name Oc
293Pretty-print symbol specified by
294.Ar name
295using CTF debugging data. Works for all symbols exported by the kernel and loaded kernel modules.
296.Pp
297If the
298.Cm d
299modifier has been specified, contents of structs nested up to
300.Ar depth
301levels deep will also be included in the output.
302.Pp
303.It Ic pprint struct Ns Oo Li / Ns Cm d depth Ic Oc Oo Ar name Oc Ns Op Ns Ar addr
304Print memory at
305.Ar addr
306as struct
307.Ar name Ns .
308Works for all structs defined by the kernel and loaded kernel modules.
309.Pp
310If the
311.Cm d
312modifier has been specified, contents of structs nested up to
313.Ar depth
314levels deep will also be included in the output.
315.Pp
316.It Xo
317.Ic write Ns Op Li / Ns Cm bhl
318.Ar addr expr1 Op Ar expr2 ...
319.Xc
320.It Xo
321.Ic w Ns Op Li / Ns Cm bhl
322.Ar addr expr1 Op Ar expr2 ...
323.Xc
324Write the expressions specified after
325.Ar addr
326on the command line at succeeding locations starting with
327.Ar addr .
328The write unit size can be specified in the modifier with a letter
329.Cm b
330(byte),
331.Cm h
332(half word) or
333.Cm l
334(long word) respectively.
335If omitted,
336long word is assumed.
337.Pp
338.Sy Warning :
339since there is no delimiter between expressions, strange
340things may happen.
341It is best to enclose each expression in parentheses.
342.Pp
343.It Ic set Li $ Ns Ar variable Oo Li = Oc Ar expr
344Set the named variable or register with the value of
345.Ar expr .
346Valid variable names are described below.
347.Pp
348.It Ic break Ns Oo Li / Ns Cm u Oc Oo Ar addr Oc Ns Op , Ns Ar count
349.It Ic b     Ns Oo Li / Ns Cm u Oc Oo Ar addr Oc Ns Op , Ns Ar count
350Set a break point at
351.Ar addr .
352If
353.Ar count
354is supplied, the
355.Ic continue
356command will not stop at this break point on the first
357.Ar count
358\- 1 times that it is hit.
359If the break point is set, a break point number is
360printed with
361.Ql # .
362This number can be used in deleting the break point
363or adding conditions to it.
364.Pp
365If the
366.Cm u
367modifier is specified, this command sets a break point in user
368address space.
369Without the
370.Cm u
371option, the address is considered to be in the kernel
372space, and a wrong space address is rejected with an error message.
373This modifier can be used only if it is supported by machine dependent
374routines.
375.Pp
376.Sy Warning :
377If a user text is shadowed by a normal user space debugger,
378user space break points may not work correctly.
379Setting a break
380point at the low-level code paths may also cause strange behavior.
381.Pp
382.It Ic delete Op Ar addr
383.It Ic d      Op Ar addr
384.It Ic delete Li # Ns Ar number
385.It Ic d      Li # Ns Ar number
386Delete the specified break point.
387The break point can be specified by a
388break point number with
389.Ql # ,
390or by using the same
391.Ar addr
392specified in the original
393.Ic break
394command, or by omitting
395.Ar addr
396to get the default address of
397.Va dot .
398.Pp
399.It Ic halt
400Halt the system.
401.Pp
402.It Ic watch Oo Ar addr Oc Ns Op , Ns Ar size
403Set a watchpoint for a region.
404Execution stops when an attempt to modify the region occurs.
405The
406.Ar size
407argument defaults to 4.
408If you specify a wrong space address, the request is rejected
409with an error message.
410.Pp
411.Sy Warning :
412Attempts to watch wired kernel memory
413may cause unrecoverable error in some systems such as i386.
414Watchpoints on user addresses work best.
415.Pp
416.It Ic hwatch Oo Ar addr Oc Ns Op , Ns Ar size
417Set a hardware watchpoint for a region if supported by the
418architecture.
419Execution stops when an attempt to modify the region occurs.
420The
421.Ar size
422argument defaults to 4.
423.Pp
424.Sy Warning :
425The hardware debug facilities do not have a concept of separate
426address spaces like the watch command does.
427Use
428.Ic hwatch
429for setting watchpoints on kernel address locations only, and avoid
430its use on user mode address spaces.
431.Pp
432.It Ic dhwatch Oo Ar addr Oc Ns Op , Ns Ar size
433Delete specified hardware watchpoint.
434.Pp
435.It Ic kill Ar sig pid
436Send signal
437.Ar sig
438to process
439.Ar pid .
440The signal is acted on upon returning from the debugger.
441This command can be used to kill a process causing resource contention
442in the case of a hung system.
443See
444.Xr signal 3
445for a list of signals.
446Note that the arguments are reversed relative to
447.Xr kill 2 .
448.Pp
449.It Ic step Ns Oo Li / Ns Cm p Oc Ns Op , Ns Ar count
450.It Ic s    Ns Oo Li / Ns Cm p Oc Ns Op , Ns Ar count
451Single step
452.Ar count
453times.
454If the
455.Cm p
456modifier is specified, print each instruction at each step.
457Otherwise, only print the last instruction.
458.Pp
459.Sy Warning :
460depending on machine type, it may not be possible to
461single-step through some low-level code paths or user space code.
462On machines with software-emulated single-stepping (e.g., pmax),
463stepping through code executed by interrupt handlers will probably
464do the wrong thing.
465.Pp
466.It Ic continue Ns Op Li / Ns Cm c
467.It Ic c Ns Op Li / Ns Cm c
468Continue execution until a breakpoint or watchpoint.
469If the
470.Cm c
471modifier is specified, count instructions while executing.
472Some machines (e.g., pmax) also count loads and stores.
473.Pp
474.Sy Warning :
475when counting, the debugger is really silently single-stepping.
476This means that single-stepping on low-level code may cause strange
477behavior.
478.Pp
479.It Ic until Ns Op Li / Ns Cm p
480Stop at the next call or return instruction.
481If the
482.Cm p
483modifier is specified, print the call nesting depth and the
484cumulative instruction count at each call or return.
485Otherwise,
486only print when the matching return is hit.
487.Pp
488.It Ic next Ns Op Li / Ns Cm p
489.It Ic match Ns Op Li / Ns Cm p
490Stop at the matching return instruction.
491If the
492.Cm p
493modifier is specified, print the call nesting depth and the
494cumulative instruction count at each call or return.
495Otherwise, only print when the matching return is hit.
496.Pp
497.It Xo
498.Ic trace Ns Op Li / Ns Cm u
499.Op Ar pid | tid Ns
500.Op , Ns Ar count
501.Xc
502.It Xo
503.Ic t Ns Op Li / Ns Cm u
504.Op Ar pid | tid Ns
505.Op , Ns Ar count
506.Xc
507.It Xo
508.Ic where Ns Op Li / Ns Cm u
509.Op Ar pid | tid Ns
510.Op , Ns Ar count
511.Xc
512.It Xo
513.Ic bt Ns Op Li / Ns Cm u
514.Op Ar pid | tid Ns
515.Op , Ns Ar count
516.Xc
517Stack trace.
518The
519.Cm u
520option traces user space; if omitted,
521.Ic trace
522only traces
523kernel space.
524The optional argument
525.Ar count
526is the number of frames to be traced.
527If
528.Ar count
529is omitted, all frames are printed.
530.Pp
531.Sy Warning :
532User space stack trace is valid
533only if the machine dependent code supports it.
534.Pp
535.It Xo
536.Ic search Ns Op Li / Ns Cm bhl
537.Ar addr
538.Ar value
539.Op Ar mask Ns
540.Op , Ns Ar count
541.Xc
542Search memory for
543.Ar value .
544The optional
545.Ar count
546argument limits the search.
547.\"
548.Pp
549.It Xo
550.Ic Ic reboot Ns Op Li / Ns Cm s
551.Op Ar seconds
552.Xc
553.It Xo
554.Ic Ic reset Ns Op Li / Ns Cm s
555.Op Ar seconds
556.Xc
557Hard reset the system.
558If the optional argument
559.Ar seconds
560is given, the debugger will wait for this long, at most a week,
561before rebooting.
562When the
563.Cm s
564modifier is given, the command will skip running any registered shutdown
565handlers and attempt the most basic reset.
566.Pp
567.It Ic thread Ar addr | tid
568Switch the debugger to the thread with ID
569.Ar tid ,
570if the argument is a decimal number, or address
571.Ar addr ,
572otherwise.
573.Pp
574.It Ic watchdog Op Ar exp
575Program the
576.Xr watchdog 4
577timer to fire in
578.Pf 2^ Ar exp
579seconds.
580If no argument is provided, the watchdog timer is disabled.
581.El
582.Ss SPECIALIZED HELPER COMMANDS
583.Bl -tag -width indent -compact
584.It Xo
585.Ic findstack
586.Ar addr
587.Xc
588Prints the address of the thread whose kernel-mode stack contains
589.Ar addr ,
590if any.
591.Pp
592.It Ic show Cm active trace
593.It Ic acttrace
594Show a stack trace for every thread running on a CPU.
595.Pp
596.It Ic show Cm all procs Ns Op Li / Ns Cm a
597.It Ic ps Ns Op Li / Ns Cm a
598Display all process information.
599The process information may not be shown if it is not
600supported in the machine, or the bottom of the stack of the
601target process is not in the main memory at that time.
602The
603.Cm a
604modifier will print command line arguments for each process.
605.\"
606.Pp
607.It Ic show Cm all tcpcbs Ns Op Li / Ns Cm b Ns Cm i Ns Cm l
608Show the same output as "show tcpcb" does, but for all
609TCP control blocks within the system.
610The
611.Cm b
612modifier will request BBLog entries to be printed.
613If the
614.Cm i
615modifier is provided, the corresponding IP control block is also shown.
616Using the
617.Cm l
618modifier will limit the output to TCP control blocks, which are locked.
619.\"
620.Pp
621.It Ic show Cm all trace
622.It Ic alltrace
623Show a stack trace for every thread in the system.
624.Pp
625.It Ic show Cm all ttys
626Show all TTY's within the system.
627Output is similar to
628.Xr pstat 8 ,
629but also includes the address of the TTY structure.
630.\"
631.Pp
632.It Ic show Cm all vnets
633Show the same output as "show vnet" does, but lists all
634virtualized network stacks within the system.
635.\"
636.Pp
637.It Ic show Cm allchains
638Show the same information like "show lockchain" does, but
639for every thread in the system.
640.\"
641.Pp
642.It Ic show Cm alllocks
643Show all locks that are currently held.
644This command is only available if
645.Xr witness 4
646is included in the kernel.
647.\"
648.Pp
649.It Ic show Cm allpcpu
650The same as "show pcpu", but for every CPU present in the system.
651.\"
652.Pp
653.It Ic show Cm allrman
654Show information related with resource management, including
655interrupt request lines, DMA request lines, I/O ports, I/O memory
656addresses, and Resource IDs.
657.\"
658.Pp
659.It Ic show Cm apic
660Dump data about APIC IDT vector mappings.
661.\"
662.Pp
663.It Ic show Cm badstacks
664Walk the
665.Xr witness 4
666graph and print any lock-order violations.
667This command is only available if
668.Xr witness 4
669is included in the kernel.
670.\"
671.Pp
672.It Ic show Cm breaks
673Show breakpoints set with the "break" command.
674.\"
675.Pp
676.It Ic show Cm bio Ar addr
677Show information about the bio structure
678.Vt struct bio
679present at
680.Ar addr .
681See the
682.Pa sys/bio.h
683header file and
684.Xr g_bio 9
685for more details on the exact meaning of the structure fields.
686.\"
687.Pp
688.It Ic show Cm buffer Ar addr
689Show information about the buf structure
690.Vt struct buf
691present at
692.Ar addr .
693See the
694.Pa sys/buf.h
695header file for more details on the exact meaning of the structure fields.
696.\"
697.Pp
698.It Ic show Cm callout Ar addr
699Show information about the callout structure
700.Vt struct callout
701present at
702.Ar addr .
703.\"
704.Pp
705.It Ic show Cm cdev Op Ar addr
706Show the internal devfs state of the cdev structure located at
707.Ar addr .
708If no argument is provided, show the list of all created cdevs, consisting of
709the devfs node name and the
710.Vt struct cdev
711address.
712.\"
713.Pp
714.It Ic show Cm conifhk
715Lists hooks currently waiting for completion in
716.Fn run_interrupt_driven_config_hooks .
717.\"
718.Pp
719.It Ic show Cm cpusets
720Print numbered root and assigned CPU affinity sets.
721See
722.Xr cpuset 2
723for more details.
724.\"
725.Pp
726.It Ic show Cm cyrixreg
727Show registers specific to the Cyrix processor.
728.\"
729.Pp
730.It Ic show Cm devmap
731Prints the contents of the static device mapping table.
732Currently only available on the
733ARM
734architecture.
735.\"
736.Pp
737.It Ic show Cm domain Ar addr
738Print protocol domain structure
739.Vt struct domain
740at address
741.Ar addr .
742See the
743.Pa sys/domain.h
744header file for more details on the exact meaning of the structure fields.
745.\"
746.Pp
747.It Ic show Cm ffs Op Ar addr
748Show brief information about ffs mount at the address
749.Ar addr ,
750if argument is given.
751Otherwise, provides the summary about each ffs mount.
752.\"
753.Pp
754.It Ic show Cm file Ar addr
755Show information about the file structure
756.Vt struct file
757present at address
758.Ar addr .
759.\"
760.Pp
761.It Ic show Cm files
762Show information about every file structure in the system.
763.\"
764.Pp
765.It Ic show Cm freepages
766Show the number of physical pages in each of the free lists.
767.\"
768.Pp
769.It Ic show Cm geom Op Ar addr
770If the
771.Ar addr
772argument is not given, displays the entire GEOM topology.
773If
774.Ar addr
775is given, displays details about the given GEOM object (class, geom,
776provider or consumer).
777.\"
778.Pp
779.It Ic show Cm idt
780Show IDT layout.
781The first column specifies the IDT vector.
782The second one is the name of the interrupt/trap handler.
783Those functions are machine dependent.
784.\"
785.Pp
786.It Ic show Cm igi_list Ar addr
787Show information about the IGMP structure
788.Vt struct igmp_ifsoftc
789present at
790.Ar addr .
791.\"
792.Pp
793.It Ic show Cm iosched Ar addr
794Show information about the I/O scheduler
795.Vt struct cam_iosched_softc
796located at
797.Ar addr .
798.\"
799.Pp
800.It Ic show Cm inodedeps Op Ar addr
801Show brief information about each inodedep structure.
802If
803.Ar addr
804is given, only inodedeps belonging to the fs located at the
805supplied address are shown.
806.\"
807.Pp
808.It Ic show Cm inpcb Ar addr
809Show information on IP Control Block
810.Vt struct in_pcb
811present at
812.Ar addr .
813.\"
814.Pp
815.It Ic show Cm intr
816Dump information about interrupt handlers.
817.\"
818.Pp
819.It Ic show Cm intrcnt
820Dump the interrupt statistics.
821.\"
822.Pp
823.It Ic show Cm irqs
824Show interrupt lines and their respective kernel threads.
825.\"
826.Pp
827.It Ic show Cm ktr Ns Op Li / Ns Cm a Ns Cm v Ns Cm V
828Print the contents of the
829.Xr ktr 4
830trace buffer.
831The
832.Cm v
833modifier will request fully verbose output, causing the file, line number, and
834timestamp to be printed for each trace entry.
835The
836.Cm V
837modifier will request only the timestamps to be printed.
838The
839.Cm a
840modifier will request that the output be unpaginated.
841.\"
842.Pp
843.It Ic show Cm lapic
844Show information from the local APIC registers for this CPU.
845.\"
846.Pp
847.It Ic show Cm lock Ar addr
848Show lock structure.
849The output format is as follows:
850.Bl -tag -width "flags"
851.It Ic class :
852Class of the lock.
853Possible types include
854.Xr mutex 9 ,
855.Xr rmlock 9 ,
856.Xr rwlock 9 ,
857.Xr sx 9 .
858.It Ic name :
859Name of the lock.
860.It Ic flags :
861Flags passed to the lock initialization function.
862.Em flags
863values are lock class specific.
864.It Ic state :
865Current state of a lock.
866.Em state
867values are lock class specific.
868.It Ic owner :
869Lock owner.
870.El
871.\"
872.Pp
873.It Ic show Cm lockchain Ar addr
874Show all threads a particular thread at address
875.Ar addr
876is waiting on based on non-spin locks.
877.\"
878.Pp
879.It Ic show Cm lockedbufs
880Show the same information as "show buf", but for every locked
881.Vt struct buf
882object.
883.\"
884.Pp
885.It Ic show Cm lockedvnods
886List all locked vnodes in the system.
887.\"
888.Pp
889.It Ic show Cm locks
890Prints all locks that are currently acquired.
891This command is only available if
892.Xr witness 4
893is included in the kernel.
894.\"
895.Pp
896.It Ic show Cm locktree
897.\"
898.Pp
899.It Ic show Cm malloc Ns Op Li / Ns Cm i
900Prints
901.Xr malloc 9
902memory allocator statistics.
903If the
904.Cm i
905modifier is specified, format output as machine-parseable comma-separated
906values ("CSV").
907The output columns are as follows:
908.Pp
909.Bl -tag -compact -offset indent -width "Requests"
910.It Ic Type
911Specifies a type of memory.
912It is the same as a description string used while defining the
913given memory type with
914.Xr MALLOC_DECLARE 9 .
915.It Ic InUse
916Number of memory allocations of the given type, for which
917.Xr free 9
918has not been called yet.
919.It Ic MemUse
920Total memory consumed by the given allocation type.
921.It Ic Requests
922Number of memory allocation requests for the given
923memory type.
924.El
925.Pp
926The same information can be gathered in userspace with
927.Dq Nm vmstat Fl m .
928.\"
929.Pp
930.It Ic show Cm map Ns Oo Li / Ns Cm f Oc Ar addr
931Prints the VM map at
932.Ar addr .
933If the
934.Cm f
935modifier is specified the
936complete map is printed.
937.\"
938.Pp
939.It Ic show Cm msgbuf
940Print the system's message buffer.
941It is the same output as in the
942.Dq Nm dmesg
943case.
944It is useful if you got a kernel panic, attached a serial cable
945to the machine and want to get the boot messages from before the
946system hang.
947.\"
948.Pp
949.It Ic show Cm mount Op Ar addr
950Displays details about the mount point located at
951.Ar addr .
952If no
953.Ar addr
954is specified,
955displays short info about all currently mounted file systems.
956.\"
957.Pp
958.It Ic show Cm object Ns Oo Li / Ns Cm f Oc Ar addr
959Prints the VM object at
960.Ar addr .
961If the
962.Cm f
963option is specified the
964complete object is printed.
965.\"
966.Pp
967.It Ic show Cm panic
968Print the panic message if set.
969.\"
970.Pp
971.It Ic show Cm page
972Show statistics on VM pages.
973.\"
974.Pp
975.It Ic show Cm pageq
976Show statistics on VM page queues.
977.\"
978.Pp
979.It Ic show Cm pciregs
980Print PCI bus registers.
981The same information can be gathered in userspace by running
982.Dq Nm pciconf Fl lv .
983.\"
984.Pp
985.It Ic show Cm pcpu
986Print current processor state.
987The output format is as follows:
988.Pp
989.Bl -tag -compact -offset indent -width "spin locks held:"
990.It Ic cpuid
991Processor identifier.
992.It Ic curthread
993Thread pointer, process identifier and the name of the process.
994.It Ic curpcb
995Control block pointer.
996.It Ic fpcurthread
997FPU thread pointer.
998.It Ic idlethread
999Idle thread pointer.
1000.It Ic APIC ID
1001CPU identifier coming from APIC.
1002.It Ic currentldt
1003LDT pointer.
1004.It Ic spin locks held
1005Names of spin locks held.
1006.El
1007.\"
1008.Pp
1009.It Ic show Cm pgrpdump
1010Dump process groups present within the system.
1011.\"
1012.Pp
1013.It Ic show Cm prison Op Ar addr
1014Show the prison structure located at
1015.Ar addr .
1016If no
1017.Ar addr
1018argument is specified, show information about all prisons in the system.
1019.\"
1020.Pp
1021.It Ic show Cm proc Op Ar addr
1022Show information about the process structure located at address
1023.Ar addr ,
1024or the current process if no argument is specified.
1025.\"
1026.Pp
1027.It Ic show Cm procvm Op Ar addr
1028Show process virtual memory layout for the process located at
1029.Ar addr ,
1030or the current process if no argument is specified.
1031.\"
1032.Pp
1033.It Ic show Cm protosw Ar addr
1034Print protocol switch structure
1035.Vt struct protosw
1036at address
1037.Ar addr .
1038.\"
1039.Pp
1040.It Ic show Cm registers Ns Op Li / Ns Cm u
1041Display the register set.
1042If the
1043.Cm u
1044modifier is specified, the register contents of the thread's previous
1045trapframe are displayed instead.
1046Usually, this corresponds to the saved state from userspace.
1047.\"
1048.Pp
1049.It Ic show Cm rman Ar addr
1050Show resource manager object
1051.Vt struct rman
1052at address
1053.Ar addr .
1054Addresses of particular pointers can be gathered with "show allrman"
1055command.
1056.\"
1057.Pp
1058.It Ic show Cm route Ar addr
1059Show route table result for destination
1060.Ar addr .
1061At this time, INET and INET6 formatted addresses are supported.
1062.\"
1063.Pp
1064.It Ic show Cm routetable Oo Ar af Oc
1065Show full route table or tables.
1066If
1067.Ar af
1068is specified, show only routes for the given numeric address family.
1069If no argument is specified, dump the route table for all address families.
1070.\"
1071.Pp
1072.It Ic show Cm rtc
1073Show real time clock value.
1074Useful for long debugging sessions.
1075.\"
1076.Pp
1077.It Ic show Cm sleepchain
1078Deprecated.
1079Now an alias for
1080.Ic show Cm lockchain .
1081.\"
1082.Pp
1083.It Ic show Cm sleepq Ar addr
1084.It Ic show Cm sleepqueue Ar addr
1085Show the
1086.Xr sleepqueue 9
1087structure located at
1088.Ar addr .
1089.\"
1090.Pp
1091.It Ic show Cm sockbuf Ar addr
1092Show the socket buffer
1093.Va struct sockbuf
1094located at
1095.Ar addr .
1096.\"
1097.Pp
1098.It Ic show Cm socket Ar addr
1099Show the socket object
1100.Vt struct socket
1101located at
1102.Ar addr .
1103.\"
1104.Pp
1105.It Ic show Cm sysregs
1106Show system registers (e.g.,
1107.Li cr0-4
1108on i386.)
1109Not present on some platforms.
1110.\"
1111.Pp
1112.It Ic show Cm tcpcb Ns Oo Li / Ns Cm b Ns Cm i Oc Ar addr
1113Print TCP control block
1114.Vt struct tcpcb
1115lying at address
1116.Ar addr .
1117For exact interpretation of output, visit
1118.Pa netinet/tcp.h
1119header file.
1120The
1121.Cm b
1122modifier will request BBLog entries to be printed.
1123If the
1124.Cm i
1125modifier is provided, the corresponding IP control block is also shown.
1126.\"
1127.Pp
1128.It Ic show Cm thread Op Ar addr | tid
1129If no
1130.Ar addr
1131or
1132.Ar tid
1133is specified, show detailed information about current thread.
1134Otherwise, print information about the thread with ID
1135.Ar tid
1136or kernel address
1137.Ar addr .
1138(If the argument is a decimal number, it is assumed to be a tid.)
1139.\"
1140.Pp
1141.It Ic show Cm threads
1142Show all threads within the system.
1143Output format is as follows:
1144.Pp
1145.Bl -tag -compact -offset indent -width "Second column"
1146.It Ic First column
1147Thread identifier (TID)
1148.It Ic Second column
1149Thread structure address
1150.It Ic Third column
1151Backtrace.
1152.El
1153.\"
1154.Pp
1155.It Ic show Cm tty Ar addr
1156Display the contents of a TTY structure in a readable form.
1157.\"
1158.Pp
1159.It Ic show Cm turnstile Ar addr
1160Show turnstile
1161.Vt struct turnstile
1162structure at address
1163.Ar addr .
1164Turnstiles are structures used within the
1165.Fx
1166kernel to implement
1167synchronization primitives which, while holding a specific type of lock, cannot
1168sleep or context switch to another thread.
1169Currently, those are:
1170.Xr mutex 9 ,
1171.Xr rwlock 9 ,
1172.Xr rmlock 9 .
1173.\"
1174.Pp
1175.It Ic show Cm uma Ns Op Li / Ns Cm i
1176Show UMA allocator statistics.
1177If the
1178.Cm i
1179modifier is specified, format output as machine-parseable comma-separated
1180values ("CSV").
1181The output contains the following columns:
1182.Pp
1183.Bl -tag -compact -offset indent -width "Total Mem"
1184.It Cm "Zone"
1185Name of the UMA zone.
1186The same string that was passed to
1187.Xr uma_zcreate 9
1188as a first argument.
1189.It Cm "Size"
1190Size of a given memory object (slab).
1191.It Cm "Used"
1192Number of slabs being currently used.
1193.It Cm "Free"
1194Number of free slabs within the UMA zone.
1195.It Cm "Requests"
1196Number of allocations requests to the given zone.
1197.It Cm "Total Mem"
1198Total memory in use (either allocated or free) by a zone, in bytes.
1199.It Cm "XFree"
1200Number of free slabs within the UMA zone that were freed on a different NUMA
1201domain than allocated.
1202(The count in the
1203.Cm "Free"
1204column is inclusive of
1205.Cm "XFree" . )
1206.El
1207.Pp
1208The same information might be gathered in the userspace
1209with the help of
1210.Dq Nm vmstat Fl z .
1211.\"
1212.Pp
1213.It Ic show Cm unpcb Ar addr
1214Shows UNIX domain socket private control block
1215.Vt struct unpcb
1216present at the address
1217.Ar addr .
1218.\"
1219.Pp
1220.It Ic show Cm vmochk
1221Prints, whether the internal VM objects are in a map somewhere
1222and none have zero ref counts.
1223.\"
1224.Pp
1225.It Ic show Cm vmopag
1226Walk the list of VM objects in the system, printing the indices and physical
1227addresses of the VM pages belonging to each object.
1228.\"
1229.Pp
1230.It Ic show Cm vnet Ar addr
1231Prints virtualized network stack
1232.Vt struct vnet
1233structure present at the address
1234.Ar addr .
1235.\"
1236.Pp
1237.It Ic show Cm vnode Ar addr
1238Prints vnode
1239.Vt struct vnode
1240structure lying at
1241.Ar addr .
1242For the exact interpretation of the output, look at the
1243.Pa sys/vnode.h
1244header file.
1245.\"
1246.Pp
1247.It Ic show Cm vnodebufs Ar addr
1248Shows clean/dirty buffer lists of the vnode located at
1249.Ar addr .
1250.\"
1251.Pp
1252.It Ic show Cm vpath Ar addr
1253Walk the namecache to lookup the pathname of the vnode located at
1254.Ar addr .
1255.\"
1256.Pp
1257.It Ic show Cm watches
1258Displays all watchpoints.
1259Shows watchpoints set with "watch" command.
1260.\"
1261.Pp
1262.It Ic show Cm witness
1263Shows information about lock acquisition coming from the
1264.Xr witness 4
1265subsystem.
1266.El
1267.Ss OFFLINE DEBUGGING COMMANDS
1268.Bl -tag -width indent -compact
1269.It Ic dump
1270Initiate a kernel core dump to the device(s) configured by
1271.Xr dumpon 8 .
1272.Pp
1273.It Ic gdb
1274Switches to remote GDB mode.
1275In remote GDB mode, another machine is required that runs
1276.Xr gdb 1 Pq Pa ports/devel/gdb
1277using the remote debug feature, with a connection to the serial
1278console port on the target machine.
1279.Pp
1280.It Ic netdump Fl s Ar server Oo Fl g Ar gateway Fl c Ar client Fl i Ar iface Oc
1281Configure
1282.Xr netdump 4
1283with the provided parameters, and immediately perform a netdump.
1284.Pp
1285There are some known limitations.
1286Principally,
1287.Xr netdump 4
1288only supports IPv4 at this time.
1289The address arguments to the
1290.Ic netdump
1291command must be dotted decimal IPv4 addresses.
1292(Hostnames are not supported.)
1293At present, the command only works if the machine is in a panic state.
1294Finally, the
1295.Nm
1296.Ic netdump
1297command does not provide any way to configure compression or encryption.
1298.Pp
1299.It Ic netgdb Fl s Ar server Oo Fl g Ar gateway Fl c Ar client Fl i Ar iface Oc
1300Initiate a
1301.Xr netgdb 4
1302session with the provided parameters.
1303.Pp
1304.Ic netgdb
1305has identical limitations to
1306.Ic netdump .
1307.Pp
1308.It Ic capture on
1309.It Ic capture off
1310.It Ic capture reset
1311.It Ic capture status
1312.Nm
1313supports a basic output capture facility, which can be used to retrieve the
1314results of debugging commands from userspace using
1315.Xr sysctl 3 .
1316.Ic capture on
1317enables output capture;
1318.Ic capture off
1319disables capture.
1320.Ic capture reset
1321will clear the capture buffer and disable capture.
1322.Ic capture status
1323will report current buffer use, buffer size, and disposition of output
1324capture.
1325.Pp
1326Userspace processes may inspect and manage
1327.Nm
1328capture state using
1329.Xr sysctl 8 :
1330.Pp
1331.Va debug.ddb.capture.bufsize
1332may be used to query or set the current capture buffer size.
1333.Pp
1334.Va debug.ddb.capture.maxbufsize
1335may be used to query the compile-time limit on the capture buffer size.
1336.Pp
1337.Va debug.ddb.capture.bytes
1338may be used to query the number of bytes of output currently in the capture
1339buffer.
1340.Pp
1341.Va debug.ddb.capture.data
1342returns the contents of the buffer as a string to an appropriately privileged
1343process.
1344.Pp
1345This facility is particularly useful in concert with the scripting and
1346.Xr textdump 4
1347facilities, allowing scripted debugging output to be captured and
1348committed to disk as part of a textdump for later analysis.
1349The contents of the capture buffer may also be inspected in a kernel core dump
1350using
1351.Xr kgdb 1 Pq Pa ports/devel/gdb .
1352.Pp
1353.It Ic run
1354.It Ic script
1355.It Ic scripts
1356.It Ic unscript
1357Run, define, list, and delete scripts.
1358See the
1359.Sx SCRIPTING
1360section for more information on the scripting facility.
1361.Pp
1362.It Ic textdump dump
1363.It Ic textdump set
1364.It Ic textdump status
1365.It Ic textdump unset
1366Use the
1367.Ic textdump dump
1368command to immediately perform a textdump.
1369More information may be found in
1370.Xr textdump 4 .
1371The
1372.Ic textdump set
1373command may be used to force the next kernel core dump to be a textdump
1374rather than a traditional memory dump or minidump.
1375.Ic textdump status
1376reports whether a textdump has been scheduled.
1377.Ic textdump unset
1378cancels a request to perform a textdump as the next kernel core dump.
1379.El
1380.Sh VARIABLES
1381The debugger accesses registers and variables as
1382.Li $ Ns Ar name .
1383Register names are as in the
1384.Dq Ic show Cm registers
1385command.
1386Some variables are suffixed with numbers, and may have some modifier
1387following a colon immediately after the variable name.
1388For example, register variables can have a
1389.Cm u
1390modifier to indicate user register (e.g.,
1391.Dq Li $eax:u ) .
1392.Pp
1393Built-in variables currently supported are:
1394.Pp
1395.Bl -tag -width ".Va tabstops" -compact
1396.It Va radix
1397Input and output radix.
1398.It Va maxoff
1399Addresses are printed as
1400.Dq Ar symbol Ns Li + Ns Ar offset
1401unless
1402.Ar offset
1403is greater than
1404.Va maxoff .
1405.It Va maxwidth
1406The width of the displayed line.
1407.It Va lines
1408The number of lines.
1409It is used by the built-in pager.
1410Setting it to 0 disables paging.
1411.It Va tabstops
1412Tab stop width.
1413.It Va work Ns Ar xx
1414Work variable;
1415.Ar xx
1416can take values from 0 to 31.
1417.El
1418.Sh EXPRESSIONS
1419Most expression operators in C are supported except
1420.Ql ~ ,
1421.Ql ^ ,
1422and unary
1423.Ql & .
1424Special rules in
1425.Nm
1426are:
1427.Bl -tag -width ".No Identifiers"
1428.It Identifiers
1429The name of a symbol is translated to the value of the symbol, which
1430is the address of the corresponding object.
1431.Ql \&.
1432and
1433.Ql \&:
1434can be used in the identifier.
1435If supported by an object format dependent routine,
1436.Sm off
1437.Oo Ar filename : Oc Ar func : lineno ,
1438.Sm on
1439.Oo Ar filename : Oc Ns Ar variable ,
1440and
1441.Oo Ar filename : Oc Ns Ar lineno
1442can be accepted as a symbol.
1443.It Numbers
1444Radix is determined by the first two letters:
1445.Ql 0x :
1446hex,
1447.Ql 0o :
1448octal,
1449.Ql 0t :
1450decimal; otherwise, follow current radix.
1451.It Li \&.
1452.Va dot
1453.It Li +
1454.Va next
1455.It Li ..
1456address of the start of the last line examined.
1457Unlike
1458.Va dot
1459or
1460.Va next ,
1461this is only changed by
1462.Ic examine
1463or
1464.Ic write
1465command.
1466.It Li '
1467last address explicitly specified.
1468.It Li $ Ns Ar variable
1469Translated to the value of the specified variable.
1470It may be followed by a
1471.Ql \&:
1472and modifiers as described above.
1473.It Ar a Ns Li # Ns Ar b
1474A binary operator which rounds up the left hand side to the next
1475multiple of right hand side.
1476.It Li * Ns Ar expr
1477Indirection.
1478It may be followed by a
1479.Ql \&:
1480and modifiers as described above.
1481.El
1482.Sh SCRIPTING
1483.Nm
1484supports a basic scripting facility to allow automating tasks or responses to
1485specific events.
1486Each script consists of a list of DDB commands to be executed sequentially,
1487and is assigned a unique name.
1488Certain script names have special meaning, and will be automatically run on
1489various
1490.Nm
1491events if scripts by those names have been defined.
1492.Pp
1493The
1494.Ic script
1495command may be used to define a script by name.
1496Scripts consist of a series of
1497.Nm
1498commands separated with the
1499.Ql \&;
1500character.
1501For example:
1502.Bd -literal -offset indent
1503script kdb.enter.panic=bt; show pcpu
1504script lockinfo=show alllocks; show lockedvnods
1505.Ed
1506.Pp
1507The
1508.Ic scripts
1509command lists currently defined scripts.
1510.Pp
1511The
1512.Ic run
1513command execute a script by name.
1514For example:
1515.Bd -literal -offset indent
1516run lockinfo
1517.Ed
1518.Pp
1519The
1520.Ic unscript
1521command may be used to delete a script by name.
1522For example:
1523.Bd -literal -offset indent
1524unscript kdb.enter.panic
1525.Ed
1526.Pp
1527These functions may also be performed from userspace using the
1528.Xr ddb 8
1529command.
1530.Pp
1531Certain scripts are run automatically, if defined, for specific
1532.Nm
1533events.
1534The follow scripts are run when various events occur:
1535.Bl -tag -width kdb.enter.powerfail
1536.It Va kdb.enter.acpi
1537The kernel debugger was entered as a result of an
1538.Xr acpi 4
1539event.
1540.It Va kdb.enter.bootflags
1541The kernel debugger was entered at boot as a result of the debugger boot
1542flag being set.
1543.It Va kdb.enter.break
1544The kernel debugger was entered as a result of a serial or console break.
1545.It Va kdb.enter.cam
1546The kernel debugger was entered as a result of a
1547.Xr CAM 4
1548event.
1549.It Va kdb.enter.mac
1550The kernel debugger was entered as a result of an assertion failure in the
1551.Xr mac_test 4
1552module of the
1553TrustedBSD MAC Framework.
1554.It Va kdb.enter.netgraph
1555The kernel debugger was entered as a result of a
1556.Xr netgraph 4
1557event.
1558.It Va kdb.enter.panic
1559.Xr panic 9
1560was called.
1561.It Va kdb.enter.powerpc
1562The kernel debugger was entered as a result of an unimplemented interrupt
1563type on the powerpc platform.
1564.It Va kdb.enter.sysctl
1565The kernel debugger was entered as a result of the
1566.Va debug.kdb.enter
1567sysctl being set.
1568.It Va kdb.enter.unionfs
1569The kernel debugger was entered as a result of an assertion failure in the
1570union file system.
1571.It Va kdb.enter.unknown
1572The kernel debugger was entered, but no reason has been set.
1573.It Va kdb.enter.vfslock
1574The kernel debugger was entered as a result of a VFS lock violation.
1575.It Va kdb.enter.watchdog
1576The kernel debugger was entered as a result of a watchdog firing.
1577.It Va kdb.enter.witness
1578The kernel debugger was entered as a result of a
1579.Xr witness 4
1580violation.
1581.El
1582.Pp
1583In the event that none of these scripts is found,
1584.Nm
1585will attempt to execute a default script:
1586.Bl -tag -width kdb.enter.powerfail
1587.It Va kdb.enter.default
1588The kernel debugger was entered, but a script exactly matching the reason for
1589entering was not defined.
1590This can be used as a catch-all to handle cases not specifically of interest;
1591for example,
1592.Va kdb.enter.witness
1593might be defined to have special handling, and
1594.Va kdb.enter.default
1595might be defined to simply panic and reboot.
1596.El
1597.Sh HINTS
1598On machines with an ISA expansion bus, a simple NMI generation card can be
1599constructed by connecting a push button between the A01 and B01 (CHCHK# and
1600GND) card fingers.
1601Momentarily shorting these two fingers together may cause the bridge chipset to
1602generate an NMI, which causes the kernel to pass control to
1603.Nm .
1604Some bridge chipsets do not generate a NMI on CHCHK#, so your mileage may vary.
1605The NMI allows one to break into the debugger on a wedged machine to
1606diagnose problems.
1607Other bus' bridge chipsets may be able to generate NMI using bus specific
1608methods.
1609There are many PCI and PCIe add-in cards which can generate NMI for
1610debugging.
1611Modern server systems typically use IPMI to generate signals to enter the
1612debugger.
1613The
1614.Va devel/ipmitool
1615port can be used to send the
1616.Cd chassis power diag
1617command which delivers an NMI to the processor.
1618Embedded systems often use JTAG for debugging, but rarely use it in
1619combination with
1620.Nm .
1621.Pp
1622Serial consoles can break to the debugger by sending a BREAK
1623condition on the serial line.
1624This requires a kernel built with
1625.Cd options BREAK_TO_DEBUGGER
1626is specified in the kernel.
1627Most terminal emulation programs can send a break sequence with a
1628special key sequence or menu selection.
1629Sending the break can be difficult or even happen spuriously in some setups.
1630An alternative method is to build a kernel with
1631.Cd options ALT_BREAK_TO_DEBUGGER
1632then the sequence of CR TILDE CTRL-B enters the debugger;
1633CR TILDE CTRL-P causes a panic; and
1634CR TILDE CTRL-R causes an immediate reboot.
1635In all these sequences, CR represents Carriage Return and is usually
1636sent by pressing the Enter or Return key.
1637TILDE is the ASCII tilde character (~).
1638CTRL-x is Control x, sent by pressing the Control key, then x, then releasing
1639both.
1640.Pp
1641The break-to-debugger behavior can be enabled by setting
1642.Xr sysctl 8
1643.Va debug.kdb.break_to_debugger
1644to 1.
1645The alt-break-to-debugger behavior can be enabled by setting
1646.Xr sysctl 8
1647.Va debug.kdb.alt_break_to_debugger
1648to 1.
1649The debugger can be entered by setting
1650.Xr sysctl 8
1651.Va debug.kdb.enter
1652to 1.
1653.Pp
1654Output can be interrupted, paused, and resumed with the control
1655characters CTRL-C, CTRL-S, and CTRL-Q.
1656Because these control characters are received as in-band data from the
1657console, there is an input buffer, and once that buffer fills
1658.Nm
1659must either stop responding to control characters or drop additional
1660input while continuing to search for control characters.
1661This behavior is controlled by the tunable
1662.Xr sysctl 8
1663.Va debug.ddb.prioritize_control_input ,
1664which defaults to 1.
1665The input buffer size is 512 bytes.
1666.Sh FILES
1667Header files mentioned in this manual page can be found below
1668.Pa /usr/include
1669directory.
1670.Pp
1671.Bl -dash -compact
1672.It
1673.Pa sys/buf.h
1674.It
1675.Pa sys/domain.h
1676.It
1677.Pa netinet/in_pcb.h
1678.It
1679.Pa sys/socket.h
1680.It
1681.Pa sys/vnode.h
1682.El
1683.Sh SEE ALSO
1684.Xr gdb 1 Pq Pa ports/devel/gdb ,
1685.Xr kgdb 1 Pq Pa ports/devel/gdb ,
1686.Xr acpi 4 ,
1687.Xr CAM 4 ,
1688.Xr gdb 4 ,
1689.Xr mac_ddb 4 ,
1690.Xr mac_test 4 ,
1691.Xr netgraph 4 ,
1692.Xr textdump 4 ,
1693.Xr witness 4 ,
1694.Xr ddb 8 ,
1695.Xr sysctl 8 ,
1696.Xr panic 9
1697.Sh HISTORY
1698The
1699.Nm
1700debugger was developed for Mach, and ported to
1701.Bx 386 0.1 .
1702This manual page translated from
1703.Xr man 7
1704macros by
1705.An Garrett Wollman .
1706.Pp
1707.An Robert N. M. Watson
1708added support for
1709.Nm
1710output capture,
1711.Xr textdump 4
1712and scripting in
1713.Fx 7.1 .
1714