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