.\" $NetBSD: ddb.4,v 1.202.2.1 2023/08/09 17:42:03 martin Exp $ .\" .\" Copyright (c) 1997 - 2019 The NetBSD Foundation, Inc. .\" All rights reserved. .\" .\" This code is derived from software contributed to The NetBSD Foundation .\" by Luke Mewburn .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" .\" --- .\" This manual page was derived from a -man.old document which bore .\" the following copyright message: .\" --- .\" .\" Mach Operating System .\" Copyright (c) 1991,1990 Carnegie Mellon University .\" All Rights Reserved. .\" .\" Permission to use, copy, modify and distribute this software and its .\" documentation is hereby granted, provided that both the copyright .\" notice and this permission notice appear in all copies of the .\" software, derivative works or modified versions, and any portions .\" thereof, and that both notices appear in supporting documentation. .\" .\" CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" .\" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR .\" ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. .\" .\" Carnegie Mellon requests users of this software to return to .\" .\" Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU .\" School of Computer Science .\" Carnegie Mellon University .\" Pittsburgh PA 15213-3890 .\" .\" any improvements or extensions that they make and grant Carnegie Mellon .\" the rights to redistribute these changes. .\" .Dd April 28, 2022 .Dt DDB 4 .Os .Sh NAME .Nm ddb .Nd in-kernel debugger .Sh SYNOPSIS .Cd options DDB .Pp To enable history editing: .Cd options DDB_HISTORY_SIZE=integer .Pp To disable entering .\" XXX: hack; .Nm automatically introduces newline in SYNOPSIS .Ic ddb upon kernel panic: .Cd options DDB_ONPANIC=0 .Pp To enable teeing all .\" XXX: hack; .Nm automatically introduces newline in SYNOPSIS .Ic ddb output to the kernel msgbuf: .Cd options DDB_TEE_MSGBUF=1 .Pp To specify commands which will be executed on each entry to .Ic ddb : .Cd options DDB_COMMANDONENTER="trace;show registers" In this case, "trace" and then "show registers" will be executed automatically. .Pp To enable extended online help: .Cd options DDB_VERBOSE_HELP . .Sh DESCRIPTION .Nm is the in-kernel debugger. It may be entered at any time via a special key sequence, and optionally may be invoked when the kernel panics. .Sh ENTERING THE DEBUGGER Unless .Dv DDB_ONPANIC is set to 0, .Nm will be activated whenever the kernel would otherwise panic. .Pp .Nm may also be activated from the console. In general, sending a break on a serial console will activate .Nm . There are also key sequences for each port that will activate .Nm from the keyboard: .Bl -tag -offset indent -width "xen domU" -compact .It alpha -- on PC style keyboards. .It amd64 -- .It "" on serial console. .It amiga -- .It atari -- .It evbarm -- on PC style keyboards. .It "" on serial console. .It "" Some models: +++++ (five plus signs) on serial console. .It hp300 - .It hpcarm -- .It hpcmips -- .It hpcsh -- .It hppa -- on PC style keyboards. .It "" +++++ (five plus signs) on PDC console .It "" on serial console. .It i386 -- .It "" on serial console. .It mac68k -, or the Interrupt switch. .It macppc Some models: -