xref: /freebsd/sbin/ddb/ddb.8 (revision b032f27c365b992e9d8e42214183b39acfb8c6ac)
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 April 4, 2008
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 Ns = Ns Ar script
41.Nm
42.Cm scripts
43.Nm
44.Cm unscript
45.Ar scriptname
46.Nm
47.Ar pathname
48.Sh DESCRIPTION
49The
50.Nm
51utility configures certain aspects of the
52.Xr ddb 4
53kernel debugger from user space that are not configured at compile-time or
54easily via
55.Xr sysctl 8
56MIB entries.
57.Pp
58To ease configuration, commands can be put in a file which is processed using
59.Nm
60as shown in the last synopsis line.
61An absolute
62.Ar pathname
63must be used.
64The file will be read line by line and applied as arguments to the
65.Nm
66utility.
67Whitespace at the beginning of lines will be ignored as will lines where the
68first non-whitespace character is
69.Ql # .
70.Sh SCRIPTING
71The
72.Nm
73utility can be used to configure aspects of
74.Xr ddb 4
75scripting from user space; scripting support is described in more detail in
76.Xr ddb 4 .
77Each of the debugger commands is available from the command line:
78.Bl -tag -width indent
79.It Cm script Ar scriptname
80Print the script named
81.Ar scriptname .
82.It Cm script Ar scriptname Ns = Ns Ar script
83Define a script named
84.Ar scriptname .
85As many scripts contain characters interpreted in special ways by the shell,
86it is advisable to enclose
87.Ar script
88in quotes.
89.It Cm scripts
90List currently defined scripts.
91.It Cm unset Ar scriptname
92Delete the script named
93.Ar scriptname .
94.El
95.Sh EXIT STATUS
96.Ex -std
97.Sh EXAMPLES
98The following example defines a script that will execute when the kernel
99debugger is entered as a result of a break signal:
100.Bd -literal -offset indent
101ddb script kdb.enter.break="show pcpu; bt"
102.Ed
103.Pp
104The following example will delete the script:
105.Pp
106.Dl "ddb unscript kdb.enter.break"
107.Pp
108For further examples, see the
109.Xr ddb 4
110and
111.Xr textdump 4
112manual pages.
113.Sh SEE ALSO
114.Xr ddb 4 ,
115.Xr textdump 4 ,
116.Xr sysctl 8
117.Sh HISTORY
118The
119.Nm
120utility first appeared in
121.Fx 8.0 .
122.Sh AUTHORS
123.An Robert N M Watson
124.Sh BUGS
125Ideally,
126.Nm
127would not exist, as all pertinent aspects of
128.Xr ddb 4
129could be configured directly via
130.Xr sysctl 8 .
131