1 .\" $NetBSD: ddb.4,v 1.126 2009/06/05 04:40:23 mrg Exp $
3 .\" Copyright (c) 1997 - 2009 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
31 .\" This manual page was derived from a -man.old document which bore
32 .\" the following copyright message:
35 .\" Mach Operating System
36 .\" Copyright (c) 1991,1990 Carnegie Mellon University
37 .\" All Rights Reserved.
39 .\" Permission to use, copy, modify and distribute this software and its
40 .\" documentation is hereby granted, provided that both the copyright
41 .\" notice and this permission notice appear in all copies of the
42 .\" software, derivative works or modified versions, and any portions
43 .\" thereof, and that both notices appear in supporting documentation.
45 .\" CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
46 .\" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
47 .\" ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
49 .\" Carnegie Mellon requests users of this software to return to
51 .\" Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
52 .\" School of Computer Science
53 .\" Carnegie Mellon University
54 .\" Pittsburgh PA 15213-3890
56 .\" any improvements or extensions that they make and grant Carnegie Mellon
57 .\" the rights to redistribute these changes.
64 .Nd in-kernel debugger
68 To enable history editing:
69 .Cd options DDB_HISTORY_SIZE=integer
72 .\" XXX: hack; .Nm automatically introduces newline in SYNOPSIS
75 .Cd options DDB_ONPANIC=0
78 .\" XXX: hack; .Nm automatically introduces newline in SYNOPSIS
80 output to the kernel msgbuf:
81 .Cd options DDB_TEE_MSGBUF=1
83 To specify commands which will be executed on each entry to
85 .Cd options DDB_COMMANDONENTER="trace;show registers"
86 In this case, "trace" and then "show registers" will be executed automatically.
88 To enable extended online help:
89 .Cd options DDB_VERBOSE_HELP .
92 is the in-kernel debugger.
93 It may be entered at any time via a special key sequence, and
94 optionally may be invoked when the kernel panics.
95 .Sh ENTERING THE DEBUGGER
100 will be activated whenever the kernel would otherwise panic.
103 may also be activated from the console.
104 In general, sending a break on a serial console will activate
106 There are also key sequences for each port that will activate
109 .Bl -tag -offset indent -width "mvme68k" -compact
111 \*[Lt]Ctrl\*[Gt]-\*[Lt]Alt\*[Gt]-\*[Lt]Esc\*[Gt] on PC style keyboards.
113 \*[Lt]Ctrl\*[Gt]-\*[Lt]Alt\*[Gt]-\*[Lt]Esc\*[Gt]
115 \*[Lt]Break\*[Gt] on serial console.
117 \*[Lt]LAlt\*[Gt]-\*[Lt]LAmiga\*[Gt]-\*[Lt]F10\*[Gt]
119 \*[Lt]Alt\*[Gt]-\*[Lt]LeftShift\*[Gt]-\*[Lt]F9\*[Gt]
121 \*[Lt]Shift\*[Gt]-\*[Lt]Reset\*[Gt]
126 \*[Lt]Break\*[Gt] on serial console.
128 \*[Lt]Ctrl\*[Gt]-\*[Lt]Alt\*[Gt]-\*[Lt]Esc\*[Gt]
130 \*[Lt]Ctrl\*[Gt]-\*[Lt]Alt\*[Gt]-\*[Lt]Esc\*[Gt]
132 \*[Lt]Ctrl\*[Gt]-\*[Lt]Alt\*[Gt]-\*[Lt]Esc\*[Gt]
134 \*[Lt]Ctrl\*[Gt]-\*[Lt]Alt\*[Gt]-\*[Lt]Esc\*[Gt]
136 \*[Lt]Break\*[Gt] on serial console.
138 \*[Lt]Command\*[Gt]-\*[Lt]Power\*[Gt], or the Interrupt switch.
141 \*[Lt]Command\*[Gt]-\*[Lt]Option\*[Gt]-\*[Lt]Power\*[Gt]
143 Abort switch on CPU card.
149 \*[Lt]Break\*[Gt] on serial console.
151 \*[Lt]L1\*[Gt]-A, or \*[Lt]Stop\*[Gt]-A on a
155 \*[Lt]Break\*[Gt] on serial console.
157 \*[Lt]L1\*[Gt]-A, or \*[Lt]Stop\*[Gt]-A on a
161 \*[Lt]Break\*[Gt] on serial console.
163 \*[Lt]L1\*[Gt]-A, or \*[Lt]Stop\*[Gt]-A on a
167 \*[Lt]Break\*[Gt] on serial console.
169 \*[Lt]Esc\*[Gt]-\*[Lt]Shift\*[Gt]-D on serial console.
171 Interrupt switch on the body.
176 \*[Lt]Ctrl\*[Gt]-\*[Lt]Alt\*[Gt]-\*[Lt]Esc\*[Gt]
179 The key sequence to activate
181 can be changed by modifying
185 If the console is not dedicated to
187 the sequence should not be easily typed by accident.
190 may be explicitly activated by the debugging code in the kernel
195 The general command syntax is:
196 .Bd -ragged -offset indent
197 .Ic command Ns Op Cm / Ns Ar modifier
202 The current memory location being edited is referred to as
204 and the next location is
206 They are displayed as hexadecimal numbers.
208 Commands that examine and/or modify memory update
210 to the address of the last line examined or the last location
213 to the next location to be examined or modified.
214 Other commands don't change
221 A blank line repeats the previous command from the address
238 is taken to be 1 for printing commands, and infinity for stack traces.
241 .Bd -ragged -offset indent
245 repeats the previous command, just as a blank line does, but with
252 functionality; if a number of lines in a command's output exceeds the number
259 and waits for a response, which may be one of:
260 .Bl -tag -offset indent -width "\*[Lt]return\*[Gt]"
266 abort the current command, and return to the command input mode.
271 variable to zero to disable this feature.
275 history editing is enabled (by defining the
276 .D1 Cd options DDB_HISTORY_SIZE=num
277 kernel option), then a history of the last
280 The history can be manipulated with the following key sequences:
281 .Bl -tag -offset indent -width "\*[Lt]Ctrl\*[Gt]-P"
282 .It \*[Lt]Ctrl\*[Gt]-P
283 retrieve previous command in history (if any).
284 .It \*[Lt]Ctrl\*[Gt]-N
285 retrieve next command in history (if any).
289 supports the following commands:
291 .It Ic \&! Ns Ar address Ns Oo Cm ( Ar expression Ns Oo Ar ,... Oc Ns Cm ) Oc
294 .It Ic break Ns Oo Cm /u Oc Ar address Ns Op Cm , Ns Ar count
299 is supplied, continues
301 times before stopping at the breakpoint.
302 If the breakpoint is set, a breakpoint number is printed with
304 This number can be used to
306 the breakpoint, or to add
312 set a breakpoint at a user-space address.
316 is considered to be in the kernel-space, and an address in the wrong
317 space will be rejected, and an error message will be emitted.
318 This modifier may only be used if it is supported by machine dependent
321 Warning: if a user text is shadowed by a normal user-space debugger,
322 user-space breakpoints may not work correctly.
323 Setting a breakpoint at the low-level code paths may also cause
325 .It Ic bt Ns Oo Cm /ul Oc Oo Ar frame-address Oc Ns Oo Cm , Ns Ar count Oc
328 .It Ic bt/t Ns Oo Cm /ul Oc Oo Ar pid Oc Ns Oo Cm , Ns Ar count Oc
331 .It Ic bt/a Ns Oo Cm /ul Oc Oo Ar lwpaddr Oc Ns Oo Cm , Ns Ar count Oc
334 .It Ic call Ar address Ns Oo Cm ( Ns Ar expression Ns Oo Ar ,... Oc Ns Cm ) Oc
335 Call the function specified by
337 with the argument(s) listed in parentheses.
338 Parentheses may be omitted if the function takes no arguments.
339 The number of arguments is currently limited to 10.
340 .It Ic continue Ns Op Cm /c
341 Continue execution until a breakpoint or watchpoint.
344 is specified, count instructions while executing.
345 Some machines (e.g., pmax) also count loads and stores.
347 Warning: when counting, the debugger is really silently
349 This means that single-stepping on low-level may cause strange
351 .It Ic delete Ar "address" | Cm # Ns Ar number
353 The target breakpoint may be specified by
357 or by the breakpoint number returned by
359 if it's prefixed with
361 .It Ic dmesg Op Ar count
362 Prints the contents of the kernel message buffer.
365 argument will limit printing to at most the last
367 bytes of the message buffer.
368 .It Ic dwatch Ar address
369 Delete the watchpoint at
371 that was previously set with
374 .It Ic examine Ns Oo Cm / Ns Ar modifier Oc Ar address Ns Op Cm , Ns Ar count
375 Display the address locations according to the format in
377 Multiple modifier formats display multiple locations.
380 isn't specified, the modifier from the last use of
384 The valid format characters for
387 .Bl -tag -offset indent -width 2n -compact
389 examine bytes (8 bits).
391 examine half-words (16 bits).
393 examine words (legacy
397 examine long words (implementation dependent)
399 print the location being examined.
401 print the location with a line number if possible.
403 display in unsigned hex.
405 display in signed hex.
407 display in unsigned octal.
409 display in signed decimal.
411 display in unsigned decimal.
413 display in current radix, signed.
415 display low 8 bits as a character.
416 Non-printing characters as displayed as an octal escape code
420 display the NUL terminated string at the location.
421 Non-printing characters are displayed as octal escapes.
423 display in unsigned hex with a character dump at the end of each line.
424 The location is displayed as hex at the beginning of each line.
426 display as a machine instruction.
428 display as a machine instruction, with possible alternative formats
429 depending upon the machine:
430 .Bl -tag -offset indent -width "sparc" -compact
432 print register operands
436 don't assume that each external label is a procedure entry mask
439 .It Ic kill Ar pid Ns Op Cm , Ns Ar signal_number
440 Send a signal to the process specified by the
444 is interpreted using the current radix (see
446 command for details).
449 isn't specified, the SIGTERM signal is sent.
450 .It Ic match Ns Op Cm /p
453 .It Ic next Ns Op Cm /p
454 Stop at the matching return instruction.
457 is specified, print the call nesting depth and the
458 cumulative instruction count at each call or return.
459 Otherwise, only print when the matching return is hit.
460 .It Ic print Ns Oo Cm /axzodurc Oc Ar address Op Ar address ...
463 according to the modifier character, as per
477 If no modifier is specified, the most recent one specified is used.
479 may be a string, and is printed
482 .Bd -literal -offset indent
483 print/x "eax = " $eax "\enecx = " $ecx "\en"
487 .Bd -literal -offset indent
491 .It Ic ps Ns Oo Cm /a Oc Ns Oo Cm /n Oc Ns Oo Cm /w Oc Ns Oo Cm /l Oc
494 .It Ic reboot Op Ar flags
495 Reboot, using the optionally supplied boot
497 which is a bitmask supporting the same values as for
499 Some of the more useful flags:
500 .Bl -column "Value" "RB_POWERDOWN" "Description"
501 .It Sy "Value" Ta Sy "Name" Ta Sy "Description"
502 .It 0x1 Ta RB_ASKNAME Ta Ask for file name to reboot from
503 .It 0x2 Ta RB_SINGLE Ta Reboot to single user mode
504 .It 0x4 Ta RB_NOSYNC Ta Don't sync before reboot
505 .It 0x8 Ta RB_HALT Ta Halt instead of reboot
506 .It 0x40 Ta RB_KDB Ta Boot into kernel debugger
507 .It 0x100 Ta RB_DUMP Ta Dump unconditionally before reboot
508 .It 0x808 Ta RB_POWERDOWN Ta Power off (or at least halt)
511 Note: Limitations of the command line interface preclude
512 specification of a boot string.
513 .It Ic search Ns Oo Cm /bhl Oc Ar address Ar value \
514 Oo Ar mask Oc Oo Cm , Ns Ar count Oc
519 The unit size is specified with a modifier character, as per
526 If no modifier is specified,
530 This command might fail in interesting ways if it doesn't find
534 doesn't always recover from touching bad memory.
538 .It Ic set Cm $ Ns Ar variable Oo Cm = Oc Ar expression
539 Set the named variable or register to the value of
541 Valid variable names are described in
543 .It Ic show all callout
544 Display information about callouts in the system.
547 for more information on callouts.
548 .It Ic show all pages
549 Display basic information about all physical pages managed by the VM system.
550 For more detailed information about a single page, use
552 .It Ic show all pools Ns Op Cm /clp
553 Display all pool information.
554 Modifiers are the same as
556 .It Ic "show\ all\ procs" Ns Oo Cm /a Oc Ns Oo Cm /n Oc Ns Oo Cm /w Oc Ns \
558 Display all process information.
562 show process information in a
565 Information printed includes: process ID, parent process ID,
566 process group, UID, process status, process flags, process
567 command name, and process wait channel message.
569 show the kernel virtual addresses of each process'
570 proc structure, u-area, and vmspace structure.
571 The vmspace address is also the address of the process'
572 vm_map structure, and can be used in the
576 show each process' PID, command, system call emulation, wait channel
577 address, and wait channel message.
579 show each process' associated LWP information, including each LWP's
580 LID, flags, kernel LWP structure address, u-area, and wait channel.
587 This command is available only on systems which support inet and ARP.
589 Display all breakpoints.
590 .It Ic show buf Ns Oo Cm /f Oc Ar address
591 Print the struct buf at
595 does nothing at this time.
596 .It Ic show event Ns Oo Cm /f Oc Ns Oo Cm /i Oc Ns Oo Cm /m Oc Ns \
598 Print all the non-zero
604 event counters with a count of zero are printed as well.
606 interrupted counters will be displayed.
608 misc counters will be displayed.
610 trap counters will be displayed.
618 are specified, all are shown.
619 You can combine any of these.
620 For example, the modifier
622 will select both interrupt and trap events, including those that are non-zero.
623 .It Ic show files Ar address
624 Display information about the vnodes of the files that are currently
625 open by the process associated with the proc structure at
627 This address can be found using the
628 .Ic show all procs /a
630 If the kernel is compiled with
631 .Cd options LOCKDEBUG
632 then details about the locking of the underlying uvm object will also
634 .It Ic show lock Ar address
635 Display information about a lock at
637 This command is useful only if a kernel is compiled with
638 .Cd options LOCKDEBUG .
639 .It Ic show malloc Ar address
642 is supplied, display the kernel memory allocator's idea on the
643 allocation status for it.
644 Also, print out global statistics for the memory allocator.
645 This command is useful only if a kernel is compiled with
646 .Cd options MALLOC_DEBUG .
647 .It Ic show map Ns Oo Cm /f Oc Ar address
652 is specified, the complete map is printed.
653 .It Ic show mount Ns Oo Cm /f Oc Ar address
654 Print the mount structure at
658 is specified, the complete vnode list is printed.
659 .It Ic show mbuf Ns Oo Cm /c Oc Ar address
660 Print the mbuf structure at
664 is specified, the mbufs in the chain are followed.
665 .It Ic show ncache Ar address
666 Dump the namecache list associated with vnode at
668 .It Ic show object Ns Oo Cm /f Oc Ar address
669 Print the vm_object at
673 is specified, the complete object is printed.
674 .It Ic show page Ns Oo Cm /f Oc Ar address
679 is specified, the complete page is printed.
680 .It Ic show pool Ns Oo Cm /clp Oc Ar address
684 .Bl -tag -width 4n -compact
686 Print the cachelist and its statistics for this pool.
688 Print the log entries for this pool.
690 Print the pagelist for this pool.
692 .It Ic show registers Ns Op Cm /u
693 Display the register set.
696 is specified, display user registers instead of kernel registers
697 or the currently save one.
701 is machine dependent.
702 If not supported, incorrect information will be displayed.
704 Print the state of the scheduler's run queues.
705 For each run queue that has an LWP, the run queue index and the list
706 of LWPs will be shown.
707 If the run queue has LWPs, but the sched_whichqs bit is not set for that
708 queue, the queue index will be prefixed with a
711 Print a selection of UVM counters and statistics.
713 Dumps the UVM histories.
714 This command is available only if a kernel is compiled with
715 .Cd options UVMHIST .
716 .It Ic show vnode Ns Oo Cm /f Oc Ar address
721 is specified, the complete vnode is printed.
723 Display all watchpoints.
724 .It Ic sifting Ns Oo Cm /F Oc Ar string
725 Search the symbol tables for all symbols of which
727 is a substring, and display them.
730 is specified, a character is displayed immediately after each symbol
731 name indicating the type of symbol.
734 .Xr a.out 5 Ns -format
736 absolute symbols display
738 text segment symbols display
740 data segment symbols display
743 segment symbols display
745 and filename symbols display
750 object symbols display
752 function symbols display
754 section symbols display
756 and file symbols display
759 To sift for a string beginning with a number, escape the first
760 character with a backslash as:
761 .Bd -literal -offset indent
764 .It Ic step Ns Oo Cm /p Oc Op Cm , Ns Ar count
770 is specified, print each instruction at each step.
771 Otherwise, only print the last instruction.
773 Warning: depending on the machine type, it may not be possible
774 to single-step through some low-level code paths or user-space
776 On machines with software-emulated single-stepping (e.g., pmax),
777 stepping through code executed by interrupt handlers will probably
780 Force a crash dump, and then reboot.
781 .It Ic trace Ns Oo Cm /u Ns Oo Cm l Oc Oc Oo Ar frame-address Oc Ns \
782 Oo Cm , Ns Ar count Oc
787 is specified, trace user-space, otherwise trace kernel-space.
789 is the number of frames to be traced.
792 is omitted, all frames are printed.
795 is specified, the trace is printed and also stored in the kernel
798 Warning: user-space stack trace is valid only if the machine dependent
800 .It Ic trace/t Ns Oo Cm l Oc Oo Ar pid Oc Ns Oo Cm , Ns Ar count Oc
805 rather than by stack frame address.
808 is interpreted using the current radix, whilst
810 displays pids in decimal; prefix
814 to force it to be interpreted as decimal (see
819 is specified, the trace is printed and also stored in the kernel
822 Warning: trace by pid is valid only if the machine dependent code
824 .It Ic trace/a Ns Oo Cm l Oc Oo Ar lwpaddr Oc Ns Oo Cm , Ns Ar count Oc
825 Stack trace by light weight process (LWP) address
826 rather than by stack frame address.
829 is specified, the trace is printed and also stored in the kernel
832 Warning: trace by LWP address is valid only if the machine dependent
834 .It Ic until Ns Op Cm /p
835 Stop at the next call or return instruction.
838 is specified, print the call nesting depth and the
839 cumulative instruction count at each call or return.
840 Otherwise, only print when the matching return is hit.
841 .It Ic watch Ar address Ns Oo Cm , Ns Ar size Oc
842 Set a watchpoint for a region.
843 Execution stops when an attempt to modify the region occurs.
847 If you specify a wrong space address, the request is
848 rejected with an error message.
850 Warning: attempts to watch wired kernel memory may cause
851 an unrecoverable error in some systems such as i386.
852 Watchpoints on user addresses work the best.
853 .It Ic whatis Ar address
854 Describe what an address is.
855 .It Ic write Ns Oo Cm /bhl Oc Ar address Ar expression Oo Ar expression ... Oc
858 at succeeding locations.
859 The unit size is specified with a modifier character, as per
866 If no modifier is specified,
870 Warning: since there is no delimiter between
871 .Ar expression Ns s ,
872 strange things may occur.
873 It's best to enclose each
876 .It Ic x Ns Oo Cm / Ns Ar modifier Oc Ar address Ns Op Cm , Ns Ar count
879 .\" XXX - these commands aren't implemented; jhawk 19 May 2000
883 .\" re-executes the most recent
885 .\" command with the same parameters except that
890 .\" Examine backward.
892 .\" re-executes the most recent
894 .\" command with the same parameters, except that
896 .\" is set to the last start address minus its size.
898 .Sh MACHINE-SPECIFIC COMMANDS
899 The "glue" code that hooks
903 kernel for any given port can also add machine specific commands
907 All of these commands are preceded by the command word
909 to indicate that they are part of the machine-specific command
911 .Ic machine reboot ) .
912 Some of these commands are:
914 .Bl -tag -width "traptrace" -compact
916 Call the PROM monitor to halt the CPU.
918 Call the PROM monitor to reboot the CPU.
921 .Bl -tag -width "traptrace" -compact
923 Print the current "panic" string.
925 Given a trap frame address, print out the trap frame.
928 .Bl -tag -width "traptrace" -compact
930 Dump CP0 (coprocessor 0) register values.
932 Print the physical address for a given kernel virtual address.
934 Print out the Translation Lookaside Buffer (TLB).
937 kernels compiled with
942 .Bl -tag -width "traptrace" -compact
948 Print switch frame and trap frames.
950 Print kernel stack usage.
953 kernels compiled with the
958 .Bl -tag -width "traptrace" -compact
960 Exit to the Sun PROM monitor.
963 .Bl -tag -width "traptrace" -compact
965 Print process context information.
967 Switch to another cpu.
969 Print data translation look-aside buffer context information.
971 Display data translation storage buffer information.
973 Display information about the listed mapping in the kernel pmap.
976 modifier to get a full listing.
978 Extract the physical address for a given virtual address from the kernel pmap.
982 Print instruction translation look-aside buffer context information.
984 Display instruction translation storage buffer information.
988 Display information about the
992 Attempt to change process context.
994 Display the pointer to the
996 for this physical address.
998 Display physical memory.
1003 modifier to get a fuller listing.
1005 Display some information about the process pointed to, or curproc.
1013 Reset the machine and enter prom (do a Software Initiated Reset).
1015 Dump the window stack.
1018 modifier to get userland information.
1020 Display full trap frame state.
1021 This is most useful for inclusion with bug reports.
1025 Display or set trap trace information.
1030 modifiers to get reversed and full information, respectively.
1032 Set or clear a physical or virtual hardware watchpoint.
1033 Pass the address to be watched, or
1035 (or omit the address) to clear the watchpoint.
1036 Optional modifiers are
1038 for physical address,
1040 for trap on read access (default: trap on write access only),
1050 Print register window information.
1051 Argument is a stack frame number (0 is
1052 top of stack, which is used when no index is given).
1055 .Bl -tag -width "traptrace" -compact
1057 Drop into monitor via abort (allows continue).
1059 Exit to Sun PROM monitor as in
1062 Reboot the machine as in
1065 Given an address, print the address, segment map, page map, and
1066 Page Table Entry (PTE).
1070 accesses registers and variables as
1072 Register names are as per the
1075 Some variables are suffixed with numbers, and may have a modifier
1076 following a colon immediately after the variable name.
1077 For example, register variables may have a
1079 modifier to indicate user register
1083 Built-in variables currently supported are:
1084 .Bl -tag -offset indent -width "maxwidth" -compact
1086 The number of lines.
1090 When this variable is set to zero the
1092 feature is disabled.
1094 Addresses are printed as
1101 The width of the displayed line.
1103 wraps the current line by printing new line when
1106 When this variable is set to zero
1108 doesn't perform any wrapping.
1110 If non-zero (the default),
1112 will be invoked when the kernel panics.
1113 If the kernel configuration option
1114 .D1 Cd options DDB_ONPANIC=0
1117 will be initialized to off.
1119 If non-zero (the default),
1120 the kernel allows to enter
1122 from the console (by break signal or special key sequence).
1123 If the kernel configuration option
1124 .D1 Cd options DDB_FROMCONSOLE=0
1127 will be initialized to off.
1129 Input and output radix.
1133 If explicitly set to non zero (zero is the default) all
1135 output will not only be displayed on screen but
1136 also be fed to the msgbuf.
1137 The default of the variable can be set using the kernel configuration option
1138 .D1 Cd options DDB_TEE_MSGBUF=1
1139 which will initialize
1142 This option is especially handy for poor souls
1143 who don't have a serial console but want to recall
1145 output from a crash investigation.
1146 This option is more generic than the /l command modifier possible for
1147 selected commands as discussed above to log the output.
1149 and this setting can give double loggings.
1150 .\" .It Va work Ns Sy xx
1151 .\" Temporary work variable.
1153 .\" is between 0 and 31.
1156 All built-in variables are accessible via
1159 Almost all expression operators in C are supported, except
1167 .Bl -tag -offset indent -width "identifier"
1170 It is translated to the address (or value) of it.
1174 can be used in the identifier.
1175 If supported by an object format dependent routine,
1178 .Oo Ar filename : Oc
1180 .Oo : Ar line\ number Oc ,
1185 .Oo Ar filename : Oc
1193 .Oo : Ar "line number" Oc ,
1196 can be accepted as a symbol.
1197 The symbol may be prefixed with
1198 .Ar symbol_table_name\^ : :
1200 .Li emulator::mach_msg_trap )
1201 to specify other than kernel symbols.
1204 Radix is determined by the first two characters:
1211 otherwise follow current radix.
1217 address of the start of the last line examined.
1222 this is only changed by the
1227 .It Cm \&" \"" XXX: emacs highlighting
1228 last address explicitly specified.
1230 register name or variable.
1231 It is translated to the value of it.
1232 It may be followed by a
1234 and modifiers as described above.
1236 a binary operator which rounds up the left hand side to the next
1237 multiple of right hand side.
1239 expression indirection.
1240 It may be followed by a
1242 and modifiers as described above.
1254 kernel debugger was written as part of the MACH project at
1255 Carnegie-Mellon University.