1.\"- 2.\" Copyright (c) 2007 Robert N. M. Watson 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24.\" SUCH DAMAGE. 25.\" 26.\" $FreeBSD$ 27.\" 28.Dd 25 December, 2007 29.Dt DDB 8 30.Os 31.Sh NAME 32.Nm ddb 33.Nd Configure DDB kernel debugger properties 34.Sh SYNOPSIS 35.Nm 36.Cm script 37.Ar scriptname 38.Nm 39.Cm script 40.Ar scriptname=script 41.Nm 42.Cm scripts 43.Nm 44.Cm unscript 45.Ar scriptname 46.Nm 47.Ar pathname 48.Sh DESCRIPTION 49.Nm 50configures certain aspects of the 51.Xr DDB 4 52kernel debugger from user space that are not configured at compile-time or 53easily via 54.Xr sysctl 8 55MIB entries. 56.Pp 57To ease configuration, commands can be put in a file which is processed using 58.Nm 59as shown in the last synopsis line. 60An absolute 61.Ar pathname 62must be used. 63The file will be read line by line and applied as arguments to the 64.Nm 65utility. 66Whitespace at the beginning of lines will be ignored as will lines where the 67first non-whitespace character is #. 68.Sh SCRIPTING 69.Nm 70can be used to configure aspects of 71.Xr DDB 4 72scripting from user space; scripting support is described in more detail in 73.Xr DDB 4 . 74Each of the debugger commands is available from the command line: 75.Bl -tag -width indent 76.It Cm script Ar scriptname 77Print the script named 78.Ar scriptname . 79.It Cm script Ar scriptname=scriptvalue 80Define a script named 81.Ar scriptname ; 82as many scripts contain characters interpreted in special ways by the shell, 83it is advisable to enclose 84.Ar scriptvalue 85in quotes. 86.It Cm scripts 87List currently defined scripts. 88.It Cm unset Ar scriptname 89Delete the script named 90.Ar scriptname . 91.El 92.Sh EXAMPLES 93The following example defines a script that will execute when the kernel 94debugger is entered as a result of a break signal: 95.Bd -literal -offset indent 96ddb script kdb.enter.break="show pcpu; bt" 97.Ed 98.Pp 99The following example will delete the script: 100.Bd -literal -offset indent 101ddb unscript kdb.enter.break 102.Ed 103.Pp 104For further examples, see the 105.Xr ddb 4 106and 107.Xr textdump 4 108man pages. 109.Sh EXIT STATUS 110.Ex -std 111.Sh SEE ALSO 112.Xr ddb 4 , 113.Xr textdump 4 , 114.Xr sysctl 8 115.Sh HISTORY 116.Nm 117first appeared in 118.Fx 8.0 . 119.Sh AUTHORS 120.An Robert N M Watson 121.Sh BUGS 122Ideally, 123.Nm 124would not exist, as all pertinent aspects of 125.Xr ddb 4 126could be configured directly via 127.Xr sysctl 8 . 128