Annotation of src/share/man/man4/ddb.4, Revision 1.144
1.144 ! jym 1: .\" $NetBSD: ddb.4,v 1.143 2011/06/23 20:54:24 wiz Exp $
1.15 lukem 2: .\"
1.122 ad 3: .\" Copyright (c) 1997 - 2009 The NetBSD Foundation, Inc.
1.15 lukem 4: .\" All rights reserved.
5: .\"
6: .\" This code is derived from software contributed to The NetBSD Foundation
7: .\" by Luke Mewburn
8: .\"
9: .\" Redistribution and use in source and binary forms, with or without
10: .\" modification, are permitted provided that the following conditions
11: .\" are met:
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.
17: .\"
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.
29: .\"
30: .\" ---
31: .\" This manual page was derived from a -man.old document which bore
32: .\" the following copyright message:
33: .\" ---
1.5 jtc 34: .\"
1.1 brezak 35: .\" Mach Operating System
36: .\" Copyright (c) 1991,1990 Carnegie Mellon University
37: .\" All Rights Reserved.
1.52 wiz 38: .\"
1.1 brezak 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.
1.52 wiz 44: .\"
1.1 brezak 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.
1.52 wiz 48: .\"
1.1 brezak 49: .\" Carnegie Mellon requests users of this software to return to
1.52 wiz 50: .\"
1.1 brezak 51: .\" Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
52: .\" School of Computer Science
53: .\" Carnegie Mellon University
54: .\" Pittsburgh PA 15213-3890
1.52 wiz 55: .\"
1.1 brezak 56: .\" any improvements or extensions that they make and grant Carnegie Mellon
57: .\" the rights to redistribute these changes.
1.15 lukem 58: .\"
1.144 ! jym 59: .Dd August 29, 2011
1.15 lukem 60: .Dt DDB 4
1.32 garbled 61: .Os
1.15 lukem 62: .Sh NAME
63: .Nm ddb
64: .Nd in-kernel debugger
65: .Sh SYNOPSIS
66: .Cd options DDB
67: .Pp
68: To enable history editing:
69: .Cd options DDB_HISTORY_SIZE=integer
70: .Pp
71: To disable entering
1.64 wiz 72: .\" XXX: hack; .Nm automatically introduces newline in SYNOPSIS
73: .Ic ddb
1.15 lukem 74: upon kernel panic:
75: .Cd options DDB_ONPANIC=0
1.79 reinoud 76: .Pp
77: To enable teeing all
78: .\" XXX: hack; .Nm automatically introduces newline in SYNOPSIS
79: .Ic ddb
80: output to the kernel msgbuf:
81: .Cd options DDB_TEE_MSGBUF=1
1.82 yamt 82: .Pp
83: To specify commands which will be executed on each entry to
84: .Ic ddb :
85: .Cd options DDB_COMMANDONENTER="trace;show registers"
1.83 wiz 86: In this case, "trace" and then "show registers" will be executed automatically.
1.104 martin 87: .Pp
88: To enable extended online help:
89: .Cd options DDB_VERBOSE_HELP .
1.15 lukem 90: .Sh DESCRIPTION
91: .Nm
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.
1.21 fair 95: .Sh ENTERING THE DEBUGGER
96: Unless
97: .Dv DDB_ONPANIC
98: is set to 0,
99: .Nm
100: will be activated whenever the kernel would otherwise panic.
101: .Pp
102: .Nm
103: may also be activated from the console.
104: In general, sending a break on a serial console will activate
1.60 wiz 105: .Nm .
1.21 fair 106: There are also key sequences for each port that will activate
107: .Nm
108: from the keyboard:
1.144 ! jym 109: .Bl -tag -offset indent -width "xen domU" -compact
1.21 fair 110: .It alpha
1.56 ross 111: \*[Lt]Ctrl\*[Gt]-\*[Lt]Alt\*[Gt]-\*[Lt]Esc\*[Gt] on PC style keyboards.
1.110 tron 112: .It amd64
113: \*[Lt]Ctrl\*[Gt]-\*[Lt]Alt\*[Gt]-\*[Lt]Esc\*[Gt]
1.125 joerg 114: .It ""
1.110 tron 115: \*[Lt]Break\*[Gt] on serial console.
1.21 fair 116: .It amiga
1.56 ross 117: \*[Lt]LAlt\*[Gt]-\*[Lt]LAmiga\*[Gt]-\*[Lt]F10\*[Gt]
1.27 leo 118: .It atari
1.56 ross 119: \*[Lt]Alt\*[Gt]-\*[Lt]LeftShift\*[Gt]-\*[Lt]F9\*[Gt]
1.21 fair 120: .It hp300
1.56 ross 121: \*[Lt]Shift\*[Gt]-\*[Lt]Reset\*[Gt]
1.100 skrll 122: .It hp700
123: +++++
124: (five plus signs)
1.125 joerg 125: .It ""
1.100 skrll 126: \*[Lt]Break\*[Gt] on serial console.
1.78 jdc 127: .It hpcarm
128: \*[Lt]Ctrl\*[Gt]-\*[Lt]Alt\*[Gt]-\*[Lt]Esc\*[Gt]
1.37 takemura 129: .It hpcmips
1.56 ross 130: \*[Lt]Ctrl\*[Gt]-\*[Lt]Alt\*[Gt]-\*[Lt]Esc\*[Gt]
1.58 uch 131: .It hpcsh
132: \*[Lt]Ctrl\*[Gt]-\*[Lt]Alt\*[Gt]-\*[Lt]Esc\*[Gt]
1.21 fair 133: .It i386
1.56 ross 134: \*[Lt]Ctrl\*[Gt]-\*[Lt]Alt\*[Gt]-\*[Lt]Esc\*[Gt]
1.125 joerg 135: .It ""
1.56 ross 136: \*[Lt]Break\*[Gt] on serial console.
1.21 fair 137: .It mac68k
1.56 ross 138: \*[Lt]Command\*[Gt]-\*[Lt]Power\*[Gt], or the Interrupt switch.
1.62 wiz 139: .It macppc
140: Some models:
141: \*[Lt]Command\*[Gt]-\*[Lt]Option\*[Gt]-\*[Lt]Power\*[Gt]
1.21 fair 142: .It mvme68k
143: Abort switch on CPU card.
144: .It pmax
1.56 ross 145: \*[Lt]Do\*[Gt] on
1.23 fair 146: .Tn LK-201
147: rcons console.
1.125 joerg 148: .It ""
1.56 ross 149: \*[Lt]Break\*[Gt] on serial console.
1.21 fair 150: .It sparc
1.56 ross 151: \*[Lt]L1\*[Gt]-A, or \*[Lt]Stop\*[Gt]-A on a
1.23 fair 152: .Tn Sun
153: keyboard.
1.125 joerg 154: .It ""
1.56 ross 155: \*[Lt]Break\*[Gt] on serial console.
1.78 jdc 156: .It sparc64
1.56 ross 157: \*[Lt]L1\*[Gt]-A, or \*[Lt]Stop\*[Gt]-A on a
1.23 fair 158: .Tn Sun
159: keyboard.
1.125 joerg 160: .It ""
1.56 ross 161: \*[Lt]Break\*[Gt] on serial console.
1.78 jdc 162: .It sun3
1.56 ross 163: \*[Lt]L1\*[Gt]-A, or \*[Lt]Stop\*[Gt]-A on a
1.23 fair 164: .Tn Sun
165: keyboard.
1.125 joerg 166: .It ""
1.56 ross 167: \*[Lt]Break\*[Gt] on serial console.
1.76 wiz 168: .It vax
169: \*[Lt]Esc\*[Gt]-\*[Lt]Shift\*[Gt]-D on serial console.
1.26 msaitoh 170: .It x68k
171: Interrupt switch on the body.
1.144 ! jym 172: .It xen domU
1.94 hubertf 173: +++++
174: (five plus signs)
1.119 ober 175: .It zaurus
176: \*[Lt]Ctrl\*[Gt]-\*[Lt]Alt\*[Gt]-\*[Lt]Esc\*[Gt]
1.21 fair 177: .El
1.23 fair 178: .Pp
1.77 wiz 179: The key sequence to activate
180: .Nm
181: can be changed by modifying
182: .Dq hw.cnmagic
183: with
184: .Xr sysctl 8 .
185: If the console is not dedicated to
186: .Nm
187: the sequence should not be easily typed by accident.
1.21 fair 188: In addition,
189: .Nm
190: may be explicitly activated by the debugging code in the kernel
191: if
192: .Cm DDB
193: is configured.
194: .Sh COMMAND SYNTAX
195: The general command syntax is:
196: .Bd -ragged -offset indent
197: .Ic command Ns Op Cm / Ns Ar modifier
198: .Ar address
199: .Op Cm , Ns Ar count
200: .Ed
1.15 lukem 201: .Pp
202: The current memory location being edited is referred to as
203: .Ar dot ,
204: and the next location is
205: .Ar next .
206: They are displayed as hexadecimal numbers.
207: .Pp
208: Commands that examine and/or modify memory update
209: .Ar dot
210: to the address of the last line examined or the last location
211: modified, and set
212: .Ar next
213: to the next location to be examined or modified.
214: Other commands don't change
215: .Ar dot ,
216: and set
217: .Ar next
218: to be the same as
219: .Ar dot .
220: .Pp
221: A blank line repeats the previous command from the address
222: .Ar next
1.39 jhawk 223: with the previous
1.15 lukem 224: .Cm count
1.39 jhawk 225: and no modifiers.
1.15 lukem 226: Specifying
227: .Cm address
228: sets
229: .Em dot
230: to the address.
1.52 wiz 231: If
1.15 lukem 232: .Cm address
233: is omitted,
234: .Em dot
235: is used.
236: A missing
237: .Cm count
238: is taken to be 1 for printing commands, and infinity for stack traces.
1.39 jhawk 239: .Pp
240: The syntax:
241: .Bd -ragged -offset indent
1.67 wiz 242: .Cm , Ns Ar count
1.39 jhawk 243: .Ed
244: .Pp
245: repeats the previous command, just as a blank line does, but with
246: the specified
247: .Cm count .
1.15 lukem 248: .Pp
249: .Nm
250: has a
1.68 wiz 251: .Xr more 1 Ns -like
1.15 lukem 252: functionality; if a number of lines in a command's output exceeds the number
253: defined in the
254: .Va lines
255: variable, then
256: .Nm
257: displays
258: .Dq "--db more--"
259: and waits for a response, which may be one of:
1.56 ross 260: .Bl -tag -offset indent -width "\*[Lt]return\*[Gt]"
1.85 wiz 261: .It Aq return
1.15 lukem 262: one more line.
1.85 wiz 263: .It Aq space
1.15 lukem 264: one more page.
1.52 wiz 265: .It Ic q
1.1 brezak 266: abort the current command, and return to the command input mode.
1.15 lukem 267: .El
268: .Pp
1.103 uwe 269: You can set
270: .Va lines
271: variable to zero to disable this feature.
272: .Pp
1.52 wiz 273: If
1.15 lukem 274: .Nm
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
278: .Cm num
279: commands is kept.
280: The history can be manipulated with the following key sequences:
1.56 ross 281: .Bl -tag -offset indent -width "\*[Lt]Ctrl\*[Gt]-P"
282: .It \*[Lt]Ctrl\*[Gt]-P
1.15 lukem 283: retrieve previous command in history (if any).
1.56 ross 284: .It \*[Lt]Ctrl\*[Gt]-N
1.15 lukem 285: retrieve next command in history (if any).
286: .El
287: .Sh COMMANDS
288: .Nm
289: supports the following commands:
290: .Bl -tag -width 5n
1.125 joerg 291: .It Ic \&! Ns Ar address Ns Oo Cm ( Ar expression Ns Oo Ar ,... Oc Ns Cm ) Oc
1.44 jhawk 292: A synonym for
293: .Ic call .
1.125 joerg 294: .It Ic break Ns Oo Cm /u Oc Ar address Ns Op Cm , Ns Ar count
1.44 jhawk 295: Set a breakpoint at
296: .Ar address .
297: If
298: .Ar count
299: is supplied, continues
1.143 wiz 300: .Pq Ar count Ns \-1
1.44 jhawk 301: times before stopping at the breakpoint.
302: If the breakpoint is set, a breakpoint number is printed with
303: .Sq \&# .
304: This number can be used to
305: .Ic delete
306: the breakpoint, or to add
307: conditions to it.
308: .Pp
309: If
310: .Cm /u
311: is specified,
312: set a breakpoint at a user-space address.
313: Without
314: .Cm /u ,
315: .Ar 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
319: routines.
320: .Pp
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
324: strange behavior.
1.125 joerg 325: .It Ic bt Ns Oo Cm /ul Oc Oo Ar frame-address Oc Ns Oo Cm , Ns Ar count Oc
1.59 jmc 326: A synonym for
327: .Ic trace .
1.125 joerg 328: .It Ic bt/t Ns Oo Cm /ul Oc Oo Ar pid Oc Ns Oo Cm , Ns Ar count Oc
1.59 jmc 329: A synonym for
1.98 mrg 330: .Ic trace/t .
1.125 joerg 331: .It Ic bt/a Ns Oo Cm /ul Oc Oo Ar lwpaddr Oc Ns Oo Cm , Ns Ar count Oc
1.99 ad 332: A synonym for
333: .Ic trace/a .
1.125 joerg 334: .It Ic call Ar address Ns Oo Cm ( Ns Ar expression Ns Oo Ar ,... Oc Ns Cm ) Oc
1.44 jhawk 335: Call the function specified by
336: .Ar address
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.
342: If
343: .Cm /c
344: is specified, count instructions while executing.
345: Some machines (e.g., pmax) also count loads and stores.
346: .Pp
347: Warning: when counting, the debugger is really silently
348: single-stepping.
349: This means that single-stepping on low-level may cause strange
350: behavior.
1.125 joerg 351: .It Ic delete Ar "address" | Cm # Ns Ar number
1.44 jhawk 352: Delete a breakpoint.
353: The target breakpoint may be specified by
354: .Ar address ,
355: as per
356: .Ic break ,
357: or by the breakpoint number returned by
358: .Ic break
359: if it's prefixed with
360: .Sq Cm \&# .
1.125 joerg 361: .It Ic dmesg Op Ar count
1.65 atatat 362: Prints the contents of the kernel message buffer.
1.69 simonb 363: The optional
364: .Ar count
365: argument will limit printing to at most the last
366: .Ar count
367: bytes of the message buffer.
1.125 joerg 368: .It Ic dwatch Ar address
1.44 jhawk 369: Delete the watchpoint at
370: .Ar address
371: that was previously set with
372: .Ic watch
373: command.
1.125 joerg 374: .It Ic examine Ns Oo Cm / Ns Ar modifier Oc Ar address Ns Op Cm , Ns Ar count
1.52 wiz 375: Display the address locations according to the format in
1.15 lukem 376: .Ar modifier .
1.1 brezak 377: Multiple modifier formats display multiple locations.
1.15 lukem 378: If
379: .Ar modifier
380: isn't specified, the modifier from the last use of
381: .Ic examine
1.1 brezak 382: is used.
1.15 lukem 383: .Pp
384: The valid format characters for
385: .Ar modifier
386: are:
1.44 jhawk 387: .Bl -tag -offset indent -width 2n -compact
1.15 lukem 388: .It Cm b
389: examine bytes (8 bits).
390: .It Cm h
391: examine half-words (16 bits).
392: .It Cm l
1.35 ross 393: examine words (legacy
394: .Dq long ,
395: 32 bits).
396: .It Cm L
397: examine long words (implementation dependent)
1.15 lukem 398: .It Cm a
399: print the location being examined.
400: .It Cm A
401: print the location with a line number if possible.
402: .It Cm x
403: display in unsigned hex.
404: .It Cm z
405: display in signed hex.
406: .It Cm o
407: display in unsigned octal.
408: .It Cm d
409: display in signed decimal.
410: .It Cm u
411: display in unsigned decimal.
412: .It Cm r
413: display in current radix, signed.
414: .It Cm c
1.1 brezak 415: display low 8 bits as a character.
1.15 lukem 416: Non-printing characters as displayed as an octal escape code
417: (e.g.,
418: .Sq \e000 ) .
419: .It Cm s
420: display the NUL terminated string at the location.
1.1 brezak 421: Non-printing characters are displayed as octal escapes.
1.15 lukem 422: .It Cm m
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.
425: .It Cm i
426: display as a machine instruction.
427: .It Cm I
428: display as a machine instruction, with possible alternative formats
429: depending upon the machine:
1.44 jhawk 430: .Bl -tag -offset indent -width "sparc" -compact
1.25 drochner 431: .It alpha
432: print register operands
433: .It m68k
434: use Motorola syntax
1.15 lukem 435: .It vax
436: don't assume that each external label is a procedure entry mask
437: .El
438: .El
1.125 joerg 439: .It Ic kill Ar pid Ns Op Cm , Ns Ar signal_number
1.44 jhawk 440: Send a signal to the process specified by the
441: .Ar pid .
442: Note that
443: .Ar pid
444: is interpreted using the current radix (see
445: .Cm trace/t
446: command for details).
447: If
448: .Ar signal_number
449: isn't specified, the SIGTERM signal is sent.
450: .It Ic match Ns Op Cm /p
1.15 lukem 451: A synonym for
1.44 jhawk 452: .Ic next .
453: .It Ic next Ns Op Cm /p
454: Stop at the matching return instruction.
455: If
456: .Cm /p
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.
1.125 joerg 460: .It Ic print Ns Oo Cm /axzodurc Oc Ar address Op Ar address ...
1.15 lukem 461: Print addresses
462: .Ar address
463: according to the modifier character, as per
464: .Ic examine .
465: Valid modifiers are:
466: .Cm /a ,
467: .Cm /x ,
468: .Cm /z ,
469: .Cm /o ,
470: .Cm /d ,
471: .Cm /u ,
472: .Cm /r ,
473: and
474: .Cm /c
475: (as per
476: .Ic examine ) .
477: If no modifier is specified, the most recent one specified is used.
478: .Ar address
479: may be a string, and is printed
480: .Dq as-is .
481: For example:
482: .Bd -literal -offset indent
483: print/x "eax = " $eax "\enecx = " $ecx "\en"
484: .Ed
485: .Pp
486: will produce:
487: .Bd -literal -offset indent
1.1 brezak 488: eax = xxxxxx
489: ecx = yyyyyy
1.15 lukem 490: .Ed
1.125 joerg 491: .It Ic ps Ns Oo Cm /a Oc Ns Oo Cm /n Oc Ns Oo Cm /w Oc Ns Oo Cm /l Oc
1.44 jhawk 492: A synonym for
1.85 wiz 493: .Ic show all procs .
1.44 jhawk 494: .It Ic reboot Op Ar flags
495: Reboot, using the optionally supplied boot
1.73 lukem 496: .Ar flags ,
1.81 fredb 497: which is a bitmask supporting the same values as for
498: .Xr reboot 2 .
499: Some of the more useful flags:
1.87 uwe 500: .Bl -column "Value" "RB_POWERDOWN" "Description"
1.73 lukem 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
1.81 fredb 507: .It 0x100 Ta RB_DUMP Ta Dump unconditionally before reboot
1.73 lukem 508: .It 0x808 Ta RB_POWERDOWN Ta Power off (or at least halt)
509: .El
1.44 jhawk 510: .Pp
511: Note: Limitations of the command line interface preclude
512: specification of a boot string.
1.125 joerg 513: .It Ic search Ns Oo Cm /bhl Oc Ar address Ar value \
514: Oo Ar mask Oc Oo Cm , Ns Ar count Oc
1.44 jhawk 515: Search memory from
516: .Ar address
517: for
518: .Ar value .
1.15 lukem 519: The unit size is specified with a modifier character, as per
520: .Ic examine .
521: Valid modifiers are:
522: .Cm /b ,
523: .Cm /h ,
524: and
525: .Cm /l .
526: If no modifier is specified,
527: .Cm /l
528: is used.
529: .Pp
1.44 jhawk 530: This command might fail in interesting ways if it doesn't find
531: .Ar value .
532: This is because
533: .Nm
534: doesn't always recover from touching bad memory.
535: The optional
536: .Ar count
537: limits the search.
1.125 joerg 538: .It Ic set Cm $ Ns Ar variable Oo Cm = Oc Ar expression
1.15 lukem 539: Set the named variable or register to the value of
540: .Ar expression .
541: Valid variable names are described in
542: .Sx VARIABLES .
1.102 pooka 543: .It Ic show all callout
544: Display information about callouts in the system.
545: See
546: .Xr callout 9
547: for more information on callouts.
1.91 bjh21 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
551: .Ic show page .
1.85 wiz 552: .It Ic show all pools Ns Op Cm /clp
1.84 yamt 553: Display all pool information.
1.89 wiz 554: Modifiers are the same as
1.85 wiz 555: .Ic show pool .
1.125 joerg 556: .It Ic "show\ all\ procs" Ns Oo Cm /a Oc Ns Oo Cm /n Oc Ns Oo Cm /w Oc Ns \
557: Oo Cm /l Oc
1.44 jhawk 558: Display all process information.
559: Valid modifiers:
560: .Bl -tag -width 3n
561: .It Cm /n
562: show process information in a
563: .Xr ps 1
1.122 ad 564: style format.
1.44 jhawk 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.
568: .It Cm /a
569: show the kernel virtual addresses of each process'
1.55 mrg 570: proc structure, u-area, and vmspace structure.
1.44 jhawk 571: The vmspace address is also the address of the process'
572: vm_map structure, and can be used in the
1.85 wiz 573: .Ic show map
1.44 jhawk 574: command.
575: .It Cm /w
576: show each process' PID, command, system call emulation, wait channel
577: address, and wait channel message.
1.96 oster 578: .It Cm /l
579: show each process' associated LWP information, including each LWP's
580: LID, flags, kernel LWP structure address, u-area, and wait channel.
1.122 ad 581: This is the default.
1.44 jhawk 582: .El
1.102 pooka 583: .It Ic show arptab
584: Dump the entire
585: .Dv AF_INET
586: routing table.
587: This command is available only on systems which support inet and ARP.
1.85 wiz 588: .It Ic show breaks
1.50 jhawk 589: Display all breakpoints.
1.125 joerg 590: .It Ic show buf Ns Oo Cm /f Oc Ar address
1.50 jhawk 591: Print the struct buf at
592: .Ar address .
593: The
594: .Cm /f
595: does nothing at this time.
1.126 mrg 596: .It Ic show event Ns Oo Cm /f Oc Ns Oo Cm /i Oc Ns Oo Cm /m Oc Ns \
597: Oo Cm /t Oc
1.57 simonb 598: Print all the non-zero
599: .Xr evcnt 9
600: event counters.
1.126 mrg 601: Valid modifiers:
602: .Bl -tag -width 3n
603: .It Cm /f
604: event counters with a count of zero are printed as well.
605: .It Cm /i
606: interrupted counters will be displayed.
607: .It Cm /m
1.127 wiz 608: misc counters will be displayed.
1.126 mrg 609: .It Cm /t
1.127 wiz 610: trap counters will be displayed.
1.126 mrg 611: .El
612: .Pp
613: If none of
614: .Cm /i ,
615: .Cm /m
616: or
617: .Cm /t
618: are specified, all are shown.
619: You can combine any of these.
620: For example, the modifier
621: .Cm /itf
622: will select both interrupt and trap events, including those that are non-zero.
1.125 joerg 623: .It Ic show files Ar address
1.115 blymn 624: Display information about the vnodes of the files that are currently
625: open by the process associated with the proc structure at
626: .Ar address .
627: This address can be found using the
628: .Ic show all procs /a
629: command.
630: If the kernel is compiled with
631: .Cd options LOCKDEBUG
632: then details about the locking of the underlying uvm object will also
633: be displayed.
1.125 joerg 634: .It Ic show lock Ar address
1.102 pooka 635: Display information about a lock at
636: .Ar address .
637: This command is useful only if a kernel is compiled with
638: .Cd options LOCKDEBUG .
1.125 joerg 639: .It Ic show malloc Ar address
1.102 pooka 640: If
641: .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 .
1.125 joerg 647: .It Ic show map Ns Oo Cm /f Oc Ar address
1.44 jhawk 648: Print the vm_map at
649: .Ar address .
650: If
651: .Cm /f
1.50 jhawk 652: is specified, the complete map is printed.
1.125 joerg 653: .It Ic show mount Ns Oo Cm /f Oc Ar address
1.74 dbj 654: Print the mount structure at
655: .Ar address .
656: If
657: .Cm /f
658: is specified, the complete vnode list is printed.
1.125 joerg 659: .It Ic show mbuf Ns Oo Cm /c Oc Ar address
1.90 yamt 660: Print the mbuf structure at
661: .Ar address .
662: If
663: .Cm /c
664: is specified, the mbufs in the chain are followed.
1.85 wiz 665: .It Ic show ncache Ar address
1.50 jhawk 666: Dump the namecache list associated with vnode at
667: .Ar address .
1.125 joerg 668: .It Ic show object Ns Oo Cm /f Oc Ar address
1.44 jhawk 669: Print the vm_object at
1.15 lukem 670: .Ar address .
671: If
1.44 jhawk 672: .Cm /f
1.50 jhawk 673: is specified, the complete object is printed.
1.125 joerg 674: .It Ic show page Ns Oo Cm /f Oc Ar address
1.50 jhawk 675: Print the vm_page at
676: .Ar address .
677: If
678: .Cm /f
679: is specified, the complete page is printed.
1.125 joerg 680: .It Ic show pool Ns Oo Cm /clp Oc Ar address
1.50 jhawk 681: Print the pool at
682: .Ar address .
683: Valid modifiers:
684: .Bl -tag -width 4n -compact
685: .It Cm /c
686: Print the cachelist and its statistics for this pool.
687: .It Cm /l
688: Print the log entries for this pool.
689: .It Cm /p
690: Print the pagelist for this pool.
691: .El
1.85 wiz 692: .It Ic show registers Ns Op Cm /u
1.44 jhawk 693: Display the register set.
1.15 lukem 694: If
695: .Cm /u
1.44 jhawk 696: is specified, display user registers instead of kernel registers
697: or the currently save one.
1.15 lukem 698: .Pp
1.44 jhawk 699: Warning: support for
700: .Cm /u
701: is machine dependent.
702: If not supported, incorrect information will be displayed.
1.85 wiz 703: .It Ic show sched_qs
1.71 thorpej 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
1.72 wiz 709: .Sq \&! .
1.85 wiz 710: .It Ic show uvmexp
1.50 jhawk 711: Print a selection of UVM counters and statistics.
1.125 joerg 712: .It Ic show uvmhist
1.116 skrll 713: Dumps the UVM histories.
714: This command is available only if a kernel is compiled with
715: .Cd options UVMHIST .
1.125 joerg 716: .It Ic show vnode Ns Oo Cm /f Oc Ar address
1.50 jhawk 717: Print the vnode at
718: .Ar address .
719: If
720: .Cm /f
721: is specified, the complete vnode is printed.
1.85 wiz 722: .It Ic show watches
1.44 jhawk 723: Display all watchpoints.
1.125 joerg 724: .It Ic sifting Ns Oo Cm /F Oc Ar string
1.46 jhawk 725: Search the symbol tables for all symbols of which
726: .Ar string
1.66 wiz 727: is a substring, and display them.
728: If
1.46 jhawk 729: .Cm /F
730: is specified, a character is displayed immediately after each symbol
731: name indicating the type of symbol.
732: .Pp
733: For
1.68 wiz 734: .Xr a.out 5 Ns -format
1.52 wiz 735: symbol tables,
1.46 jhawk 736: absolute symbols display
737: .Sy @ ,
738: text segment symbols display
739: .Sy * ,
740: data segment symbols display
741: .Sy + ,
742: .Tn BSS
743: segment symbols display
744: .Sy - ,
745: and filename symbols display
746: .Sy / .
747: For
748: .Tn ELF Ns -format
749: symbol tables,
750: object symbols display
751: .Sy + ,
752: function symbols display
753: .Sy * ,
754: section symbols display
1.56 ross 755: .Sy \*[Am] ,
1.46 jhawk 756: and file symbols display
757: .Sy / .
1.47 jhawk 758: .Pp
759: To sift for a string beginning with a number, escape the first
760: character with a backslash as:
761: .Bd -literal -offset indent
762: sifting \\386
763: .Ed
1.125 joerg 764: .It Ic step Ns Oo Cm /p Oc Op Cm , Ns Ar count
1.15 lukem 765: Single-step
766: .Ar count
767: times.
768: If
769: .Cm /p
770: is specified, print each instruction at each step.
1.1 brezak 771: Otherwise, only print the last instruction.
1.15 lukem 772: .Pp
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
775: code.
1.1 brezak 776: On machines with software-emulated single-stepping (e.g., pmax),
777: stepping through code executed by interrupt handlers will probably
778: do the wrong thing.
1.44 jhawk 779: .It Ic sync
780: Force a crash dump, and then reboot.
1.125 joerg 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
1.15 lukem 783: Stack trace from
784: .Ar frame-address .
785: If
786: .Cm /u
787: is specified, trace user-space, otherwise trace kernel-space.
788: .Ar count
789: is the number of frames to be traced.
790: If
791: .Ar count
792: is omitted, all frames are printed.
1.65 atatat 793: If
794: .Cm /l
795: is specified, the trace is printed and also stored in the kernel
796: message buffer.
1.15 lukem 797: .Pp
798: Warning: user-space stack trace is valid only if the machine dependent
799: code supports it.
1.125 joerg 800: .It Ic trace/t Ns Oo Cm l Oc Oo Ar pid Oc Ns Oo Cm , Ns Ar count Oc
1.15 lukem 801: Stack trace by
802: .Dq thread
1.52 wiz 803: (process, on
1.18 perry 804: .Nx )
805: rather than by stack frame address.
1.15 lukem 806: Note that
807: .Ar pid
808: is interpreted using the current radix, whilst
809: .Ic ps
810: displays pids in decimal; prefix
811: .Ar pid
812: with
813: .Sq 0t
1.30 msaitoh 814: to force it to be interpreted as decimal (see
815: .Sx VARIABLES
1.65 atatat 816: section for radix).
817: If
818: .Cm /l
819: is specified, the trace is printed and also stored in the kernel
820: message buffer.
1.15 lukem 821: .Pp
1.10 sommerfe 822: Warning: trace by pid is valid only if the machine dependent code
823: supports it.
1.125 joerg 824: .It Ic trace/a Ns Oo Cm l Oc Oo Ar lwpaddr Oc Ns Oo Cm , Ns Ar count Oc
1.99 ad 825: Stack trace by light weight process (LWP) address
826: rather than by stack frame address.
827: If
828: .Cm /l
829: is specified, the trace is printed and also stored in the kernel
830: message buffer.
831: .Pp
832: Warning: trace by LWP address is valid only if the machine dependent
833: code supports it.
1.44 jhawk 834: .It Ic until Ns Op Cm /p
835: Stop at the next call or return instruction.
1.15 lukem 836: If
1.44 jhawk 837: .Cm /p
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.
1.125 joerg 841: .It Ic watch Ar address Ns Oo Cm , Ns Ar size Oc
1.15 lukem 842: Set a watchpoint for a region.
843: Execution stops when an attempt to modify the region occurs.
844: .Ar size
845: defaults to 4.
846: .Pp
847: If you specify a wrong space address, the request is
848: rejected with an error message.
849: .Pp
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.
1.125 joerg 853: .It Ic whatis Ar address
1.108 yamt 854: Describe what an address is.
1.134 phx 855: .It Ic write Ns Oo Cm /bhlBHL Oc Ar address Ar expression Oo Ar expression ... Oc
1.44 jhawk 856: Write the
857: .Ar expression Ns s
858: at succeeding locations.
859: The unit size is specified with a modifier character, as per
860: .Ic examine .
861: Valid modifiers are:
862: .Cm /b ,
863: .Cm /h ,
864: and
865: .Cm /l .
866: If no modifier is specified,
867: .Cm /l
868: is used.
869: .Pp
1.134 phx 870: Specifying the modifiers in upper case,
871: .Cm /B ,
872: .Cm /H ,
873: .Cm /L ,
874: will prevent
875: .Nm
876: from reading the memory location first, which is useful for avoiding
877: side effects when writing to I/O memory regions.
878: .Pp
1.44 jhawk 879: Warning: since there is no delimiter between
880: .Ar expression Ns s ,
881: strange things may occur.
882: It's best to enclose each
883: .Ar expression
884: in parentheses.
1.125 joerg 885: .It Ic x Ns Oo Cm / Ns Ar modifier Oc Ar address Ns Op Cm , Ns Ar count
1.41 jhawk 886: A synonym for
1.44 jhawk 887: .Ic examine .
888: .\" XXX - these commands aren't implemented; jhawk 19 May 2000
889: .\" .It Ic xf
890: .\" Examine forward.
891: .\" .Ic xf
892: .\" re-executes the most recent
893: .\" .Ic execute
894: .\" command with the same parameters except that
895: .\" .Ar address
896: .\" is set to
897: .\" .Ar next .
898: .\" .It Ic xb
899: .\" Examine backward.
900: .\" .Ic xb
901: .\" re-executes the most recent
902: .\" .Ic execute
903: .\" command with the same parameters, except that
904: .\" .Ar address
905: .\" is set to the last start address minus its size.
1.15 lukem 906: .El
1.19 fair 907: .Sh MACHINE-SPECIFIC COMMANDS
908: The "glue" code that hooks
909: .Nm
910: into the
911: .Nx
912: kernel for any given port can also add machine specific commands
913: to the
914: .Nm
915: command parser.
916: All of these commands are preceded by the command word
917: .Em machine
918: to indicate that they are part of the machine-specific command
1.23 fair 919: set (e.g.
1.85 wiz 920: .Ic machine reboot ) .
1.19 fair 921: Some of these commands are:
1.140 mrg 922: .Ss ACORN26
923: .Bl -tag -width "traptrace" -compact
924: .It Ic bsw
1.141 wiz 925: Writes one or two bytes to the IObus.
1.140 mrg 926: Takes an address and a value.
927: Use the
928: .Dq b
929: modifier to write a single byte and the
930: .Dq h
931: modifier to write two bytes.
932: .It Ic frame
933: Given a trap frame address, print out the trap frame.
934: .It Ic irqstat
935: Display the IRQ statistics
936: .It Ic panic
937: Print the current "panic" string.
938: .El
1.23 fair 939: .Ss ALPHA
1.112 chris 940: .Bl -tag -width "traptrace" -compact
1.139 mrg 941: .It Ic cpu
942: Switch to another cpu.
943: .\" .It Ic halt
944: .\" Call the PROM monitor to halt the CPU.
945: .\" .It Ic reboot
946: .\" Call the PROM monitor to reboot the CPU.
1.19 fair 947: .El
1.140 mrg 948: .Ss AMD64
949: .Bl -tag -width "traptrace" -compact
950: .It Ic cpu
951: Switch to another cpu.
952: .El
1.23 fair 953: .Ss ARM32
1.112 chris 954: .Bl -tag -width "traptrace" -compact
1.140 mrg 955: .It Ic frame
956: Given a trap frame address, print out the trap frame.
1.23 fair 957: .It Ic panic
1.21 fair 958: Print the current "panic" string.
1.19 fair 959: .El
1.137 skrll 960: .Ss HP700
961: .Bl -tag -width "traptrace" -compact
962: .It Ic frame
963: Without an address the default trap frame is printed.
964: Otherwise, the trap frame address can be given, or, when the
965: .Dq l
966: modifier is used, an LWP address.
967: .El
1.140 mrg 968: .Ss I386
969: .Bl -tag -width "traptrace" -compact
970: .It Ic cpu
971: Switch to another cpu.
972: .El
973: .Ss IA64
974: .Bl -tag -width "traptrace" -compact
975: .It Ic vector
976: Without a vector, information about all 256 vectors is shown.
977: Otherwise, the given vector is shown.
978: .El
1.23 fair 979: .Ss MIPS
1.112 chris 980: .Bl -tag -width "traptrace" -compact
1.114 tsutsui 981: .It Ic cp0
982: Dump CP0 (coprocessor 0) register values.
1.38 soren 983: .It Ic kvtop
984: Print the physical address for a given kernel virtual address.
1.23 fair 985: .It Ic tlb
1.21 fair 986: Print out the Translation Lookaside Buffer (TLB).
1.19 fair 987: Only works in
988: .Nx
1.23 fair 989: kernels compiled with
990: .Dv DEBUG
991: option.
1.58 uch 992: .El
1.132 phx 993: .Ss POWERPC 4xx
1.130 mrg 994: .Bl -tag -width "traptrace" -compact
995: .It Ic ctx
996: Print process MMU context information.
997: .It Ic pv
1.131 wiz 998: Print PA-\*[Gt]VA mapping information.
1.130 mrg 999: .It Ic reset
1000: Reset the system.
1001: .It Ic tf
1002: Display the contents of the trapframe.
1003: .It Ic tlb
1004: Display instruction translation storage buffer information.
1005: .It Ic dcr
1006: Set the DCR register.
1007: Must be between 0x00 and 0x3ff.
1008: .It Ic user
1009: Display user memory.
1010: Use the
1011: .Dq i
1012: modifier to get instruction decoding.
1013: .El
1.132 phx 1014: .Ss POWERPC OEA
1015: .Bl -tag -width "traptrace" -compact
1016: .It Ic bat
1017: Print BAT registers and translations.
1018: .It Ic mmu
1019: Print MMU registers.
1020: .El
1.58 uch 1021: .Ss SH3
1.112 chris 1022: .Bl -tag -width "traptrace" -compact
1.58 uch 1023: .It Ic tlb
1.130 mrg 1024: Print TLB entries.
1.58 uch 1025: .It Ic cache
1.130 mrg 1026: Print cache entries.
1.58 uch 1027: .It Ic frame
1028: Print switch frame and trap frames.
1029: .It Ic stack
1.66 wiz 1030: Print kernel stack usage.
1.75 wiz 1031: Only works in
1032: .Nx
1033: kernels compiled with the
1034: .Dv KSTACK_DEBUG
1035: option.
1.19 fair 1036: .El
1.23 fair 1037: .Ss SPARC
1.112 chris 1038: .Bl -tag -width "traptrace" -compact
1.128 mrg 1039: .It Ic cpu
1040: Switch to another cpu.
1.23 fair 1041: .It Ic prom
1.128 mrg 1042: Enter the Sun PROM monitor.
1043: .It Ic proc
1044: Display some information about the LWP pointed to, or curlwp.
1045: .It Ic pcb
1046: Display information about the
1047: .Dq struct pcb
1048: listed.
1049: .It Ic page
1050: Display the pointer to the
1051: .Dq struct vm_page
1052: for this physical address.
1.49 mrg 1053: .El
1054: .Ss SPARC64
1.112 chris 1055: .Bl -tag -width "traptrace" -compact
1.49 mrg 1056: .It Ic ctx
1057: Print process context information.
1.105 martin 1058: .It Ic cpu
1059: Switch to another cpu.
1.49 mrg 1060: .It Ic dtlb
1061: Print data translation look-aside buffer context information.
1062: .It Ic dtsb
1063: Display data translation storage buffer information.
1064: .It Ic kmap
1.66 wiz 1065: Display information about the listed mapping in the kernel pmap.
1066: Use the
1.49 mrg 1067: .Dq f
1068: modifier to get a full listing.
1.105 martin 1069: .It Ic extract
1070: Extract the physical address for a given virtual address from the kernel pmap.
1071: .It Ic fpstate
1072: Dump the FPU state.
1073: .It Ic itlb
1074: Print instruction translation look-aside buffer context information.
1075: .It Ic itsb
1076: Display instruction translation storage buffer information.
1077: .It Ic lwp
1078: Display a struct lwp
1.49 mrg 1079: .It Ic pcb
1080: Display information about the
1.52 wiz 1081: .Dq struct pcb
1.49 mrg 1082: listed.
1083: .It Ic pctx
1084: Attempt to change process context.
1085: .It Ic page
1086: Display the pointer to the
1087: .Dq struct vm_page
1088: for this physical address.
1089: .It Ic phys
1090: Display physical memory.
1091: .It Ic pmap
1.66 wiz 1092: Display the pmap.
1093: Use the
1.49 mrg 1094: .Dq f
1095: modifier to get a fuller listing.
1096: .It Ic proc
1097: Display some information about the process pointed to, or curproc.
1098: .It Ic prom
1.63 wiz 1099: Enter the OFW PROM.
1.49 mrg 1100: .It Ic pv
1101: Display the
1102: .Dq struct pv_entry
1103: pointed to.
1.106 martin 1104: .It Ic sir
1105: Reset the machine and enter prom (do a Software Initiated Reset).
1.49 mrg 1106: .It Ic stack
1.66 wiz 1107: Dump the window stack.
1108: Use the
1.49 mrg 1109: .Dq u
1110: modifier to get userland information.
1111: .It Ic tf
1.66 wiz 1112: Display full trap frame state.
1113: This is most useful for inclusion with bug reports.
1.49 mrg 1114: .It Ic ts
1115: Display trap state.
1116: .It Ic traptrace
1.66 wiz 1117: Display or set trap trace information.
1118: Use the
1.49 mrg 1119: .Dq r
1120: and
1121: .Dq f
1122: modifiers to get reversed and full information, respectively.
1123: .It Ic watch
1.66 wiz 1124: Set or clear a physical or virtual hardware watchpoint.
1125: Pass the address to be watched, or
1.49 mrg 1126: .Dq 0
1.107 wiz 1127: (or omit the address) to clear the watchpoint.
1.106 martin 1128: Optional modifiers are
1.49 mrg 1129: .Dq p
1.106 martin 1130: for physical address,
1131: .Dq r
1132: for trap on read access (default: trap on write access only),
1133: .Dq b
1134: for 8 bit width,
1135: .Dq h
1136: for 16 bit,
1137: .Dq l
1.107 wiz 1138: for 32 bit or
1.106 martin 1139: .Dq L
1140: for 64 bit.
1.49 mrg 1141: .It Ic window
1.123 wiz 1142: Print register window information.
1143: Argument is a stack frame number (0 is
1.106 martin 1144: top of stack, which is used when no index is given).
1.19 fair 1145: .El
1.138 mrg 1146: .Ss SUN2, SUN3 and SUN3X
1.112 chris 1147: .Bl -tag -width "traptrace" -compact
1.23 fair 1148: .It Ic abort
1.19 fair 1149: Drop into monitor via abort (allows continue).
1.23 fair 1150: .It Ic halt
1.19 fair 1151: Exit to Sun PROM monitor as in
1152: .Xr halt 8 .
1.23 fair 1153: .It Ic reboot
1.19 fair 1154: Reboot the machine as in
1155: .Xr reboot 8 .
1.23 fair 1156: .It Ic pgmap
1.19 fair 1157: Given an address, print the address, segment map, page map, and
1158: Page Table Entry (PTE).
1159: .El
1.140 mrg 1160: .Ss VAX
1161: .Bl -tag -width "traptrace" -compact
1162: .It Ic cpu
1163: Switch to another cpu.
1164: .El
1.15 lukem 1165: .Sh VARIABLES
1166: .Nm
1167: accesses registers and variables as
1168: .Cm $ Ns Ar name .
1169: Register names are as per the
1.85 wiz 1170: .Ic show registers
1.1 brezak 1171: command.
1.15 lukem 1172: Some variables are suffixed with numbers, and may have a modifier
1.1 brezak 1173: following a colon immediately after the variable name.
1.15 lukem 1174: For example, register variables may have a
1175: .Sq u
1176: modifier to indicate user register
1177: (e.g.,
1178: .Li "$eax:u" ) .
1179: .Pp
1.1 brezak 1180: Built-in variables currently supported are:
1.44 jhawk 1181: .Bl -tag -offset indent -width "maxwidth" -compact
1.15 lukem 1182: .It Va lines
1183: The number of lines.
1184: This is used by the
1185: .Ic more
1186: feature.
1.107 wiz 1187: When this variable is set to zero the
1.103 uwe 1188: .Ic more
1189: feature is disabled.
1.15 lukem 1190: .It Va maxoff
1191: Addresses are printed as
1192: .Li 'symbol'+offset
1193: unless
1194: .Li offset
1195: is greater than
1196: .Va maxoff .
1197: .It Va maxwidth
1.1 brezak 1198: The width of the displayed line.
1.103 uwe 1199: .Nm
1200: wraps the current line by printing new line when
1201: .Va maxwidth
1202: column is reached.
1.107 wiz 1203: When this variable is set to zero
1.103 uwe 1204: .Nm
1205: doesn't perform any wrapping.
1.15 lukem 1206: .It Va onpanic
1.142 riz 1207: If greater than zero (the default is 1),
1.15 lukem 1208: .Nm
1209: will be invoked when the kernel panics.
1210: If the kernel configuration option
1211: .D1 Cd options DDB_ONPANIC=0
1212: is used,
1213: .Va onpanic
1.142 riz 1214: will be initialized to off, causing a stack trace to be printed and
1215: the system to be rebooted instead of
1216: .Nm
1217: being entered.
1.143 wiz 1218: Other useful settings are \-1, which suppresses the stack trace before
1.142 riz 1219: reboot, and 2, which causes a stack trace to be printed and
1220: .Nm
1221: to be entered.
1.51 msaitoh 1222: .It Va fromconsole
1223: If non-zero (the default),
1224: the kernel allows to enter
1225: .Nm
1226: from the console (by break signal or special key sequence).
1227: If the kernel configuration option
1228: .D1 Cd options DDB_FROMCONSOLE=0
1229: is used,
1230: .Va fromconsole
1.52 wiz 1231: will be initialized to off.
1.15 lukem 1232: .It Va radix
1233: Input and output radix.
1234: .It Va tabstops
1.1 brezak 1235: Tab stop width.
1.79 reinoud 1236: .It Va tee_msgbuf
1.93 wiz 1237: If explicitly set to non zero (zero is the default) all
1.79 reinoud 1238: .Nm
1239: output will not only be displayed on screen but
1240: also be fed to the msgbuf.
1241: The default of the variable can be set using the kernel configuration option
1242: .D1 Cd options DDB_TEE_MSGBUF=1
1.107 wiz 1243: which will initialize
1.79 reinoud 1244: .Va tee_msgbuf
1245: to be 1.
1246: This option is especially handy for poor souls
1247: who don't have a serial console but want to recall
1248: .Nm
1249: output from a crash investigation.
1250: This option is more generic than the /l command modifier possible for
1.80 wiz 1251: selected commands as discussed above to log the output.
1252: Mixing both /l
1.79 reinoud 1253: and this setting can give double loggings.
1.54 jhawk 1254: .\" .It Va work Ns Sy xx
1255: .\" Temporary work variable.
1256: .\" .Sq Sy xx
1257: .\" is between 0 and 31.
1.15 lukem 1258: .El
1259: .Pp
1260: All built-in variables are accessible via
1261: .Xr sysctl 3 .
1262: .Sh EXPRESSIONS
1263: Almost all expression operators in C are supported, except
1.31 mycroft 1264: .Sq \&~ ,
1265: .Sq \&^ ,
1.15 lukem 1266: and unary
1.56 ross 1267: .Sq \&\*[Am] .
1.15 lukem 1268: Special rules in
1269: .Nm
1.1 brezak 1270: are:
1.15 lukem 1271: .Bl -tag -offset indent -width "identifier"
1272: .It Ar identifier
1273: name of a symbol.
1274: It is translated to the address (or value) of it.
1.31 mycroft 1275: .Sq \&.
1.15 lukem 1276: and
1.31 mycroft 1277: .Sq \&:
1.15 lukem 1278: can be used in the identifier.
1279: If supported by an object format dependent routine,
1280: .Sm off
1281: .Xo
1282: .Oo Ar filename : Oc
1283: .Ar function
1.86 uwe 1284: .Oo : Ar line\ number Oc ,
1.15 lukem 1285: .Xc
1.86 uwe 1286: .Sm on
1287: .Sm off
1.15 lukem 1288: .Xo
1289: .Oo Ar filename : Oc
1290: .Ar variable ,
1291: .Xc
1.86 uwe 1292: .Sm on
1.15 lukem 1293: and
1.86 uwe 1294: .Sm off
1.15 lukem 1295: .Xo
1296: .Ar filename
1297: .Oo : Ar "line number" Oc ,
1298: .Xc
1299: .Sm on
1.1 brezak 1300: can be accepted as a symbol.
1.15 lukem 1301: The symbol may be prefixed with
1.86 uwe 1302: .Ar symbol_table_name\^ : :
1.15 lukem 1303: (e.g.,
1304: .Li emulator::mach_msg_trap )
1305: to specify other than kernel symbols.
1306: .It Ar number
1307: number.
1308: Radix is determined by the first two characters:
1309: .Sq 0x
1310: - hex,
1311: .Sq 0o
1312: - octal,
1313: .Sq 0t
1314: - decimal,
1315: otherwise follow current radix.
1316: .It Cm .
1317: .Ar dot
1318: .It Cm +
1319: .Ar next
1320: .It Cm ..
1.1 brezak 1321: address of the start of the last line examined.
1.15 lukem 1322: Unlike
1323: .Ar dot
1324: or
1325: .Ar next ,
1326: this is only changed by the
1327: .Ic examine
1328: or
1329: .Ic write
1330: commands.
1.86 uwe 1331: .It Cm \&" \"" XXX: emacs highlighting
1.1 brezak 1332: last address explicitly specified.
1.15 lukem 1333: .It Cm $ Ns Ar name
1334: register name or variable.
1335: It is translated to the value of it.
1336: It may be followed by a
1.31 mycroft 1337: .Sq \&:
1.15 lukem 1338: and modifiers as described above.
1.86 uwe 1339: .It Cm #
1340: a binary operator which rounds up the left hand side to the next
1341: multiple of right hand side.
1.15 lukem 1342: .It Cm * Ns Ar expr
1343: expression indirection.
1344: It may be followed by a
1.31 mycroft 1345: .Sq \&:
1.15 lukem 1346: and modifiers as described above.
1347: .El
1.53 wiz 1348: .Sh SEE ALSO
1.83 wiz 1349: .Xr reboot 2 ,
1.53 wiz 1350: .Xr options 4 ,
1.136 wiz 1351: .Xr crash 8 ,
1.81 fredb 1352: .Xr reboot 8 ,
1.77 wiz 1353: .Xr sysctl 8 ,
1354: .Xr cnmagic 9
1.19 fair 1355: .Sh HISTORY
1356: The
1357: .Nm
1358: kernel debugger was written as part of the MACH project at
1359: Carnegie-Mellon University.
CVSweb <webmaster@jp.NetBSD.org>