From 15c3f17df08bbfcf604019832f4f92806388ef32 Mon Sep 17 00:00:00 2001 From: ru Date: Fri, 4 Apr 2008 07:31:43 +0000 Subject: - Normalize usage(), add "ddb pathname" syntax. - Revise the manpage. --- sbin/ddb/ddb.8 | 43 +++++++++++++++++++++++-------------------- sbin/ddb/ddb.c | 10 +++++----- 2 files changed, 28 insertions(+), 25 deletions(-) (limited to 'sbin') diff --git a/sbin/ddb/ddb.8 b/sbin/ddb/ddb.8 index 9f355f2..0165f56 100644 --- a/sbin/ddb/ddb.8 +++ b/sbin/ddb/ddb.8 @@ -25,19 +25,19 @@ .\" .\" $FreeBSD$ .\" -.Dd 25 December, 2007 +.Dd April 4, 2008 .Dt DDB 8 .Os .Sh NAME .Nm ddb -.Nd Configure DDB kernel debugger properties +.Nd "configure DDB kernel debugger properties" .Sh SYNOPSIS .Nm .Cm script .Ar scriptname .Nm .Cm script -.Ar scriptname=script +.Ar scriptname Ns = Ns Ar script .Nm .Cm scripts .Nm @@ -46,9 +46,10 @@ .Nm .Ar pathname .Sh DESCRIPTION +The .Nm -configures certain aspects of the -.Xr DDB 4 +utility configures certain aspects of the +.Xr ddb 4 kernel debugger from user space that are not configured at compile-time or easily via .Xr sysctl 8 @@ -64,24 +65,26 @@ The file will be read line by line and applied as arguments to the .Nm utility. Whitespace at the beginning of lines will be ignored as will lines where the -first non-whitespace character is #. +first non-whitespace character is +.Ql # . .Sh SCRIPTING +The .Nm -can be used to configure aspects of -.Xr DDB 4 +utility can be used to configure aspects of +.Xr ddb 4 scripting from user space; scripting support is described in more detail in -.Xr DDB 4 . +.Xr ddb 4 . Each of the debugger commands is available from the command line: .Bl -tag -width indent .It Cm script Ar scriptname Print the script named .Ar scriptname . -.It Cm script Ar scriptname=scriptvalue +.It Cm script Ar scriptname Ns = Ns Ar script Define a script named -.Ar scriptname ; -as many scripts contain characters interpreted in special ways by the shell, +.Ar scriptname . +As many scripts contain characters interpreted in special ways by the shell, it is advisable to enclose -.Ar scriptvalue +.Ar script in quotes. .It Cm scripts List currently defined scripts. @@ -89,6 +92,8 @@ List currently defined scripts. Delete the script named .Ar scriptname . .El +.Sh EXIT STATUS +.Ex -std .Sh EXAMPLES The following example defines a script that will execute when the kernel debugger is entered as a result of a break signal: @@ -97,24 +102,22 @@ ddb script kdb.enter.break="show pcpu; bt" .Ed .Pp The following example will delete the script: -.Bd -literal -offset indent -ddb unscript kdb.enter.break -.Ed +.Pp +.Dl "ddb unscript kdb.enter.break" .Pp For further examples, see the .Xr ddb 4 and .Xr textdump 4 -man pages. -.Sh EXIT STATUS -.Ex -std +manual pages. .Sh SEE ALSO .Xr ddb 4 , .Xr textdump 4 , .Xr sysctl 8 .Sh HISTORY +The .Nm -first appeared in +utility first appeared in .Fx 8.0 . .Sh AUTHORS .An Robert N M Watson diff --git a/sbin/ddb/ddb.c b/sbin/ddb/ddb.c index 869e34c..5e86efc 100644 --- a/sbin/ddb/ddb.c +++ b/sbin/ddb/ddb.c @@ -43,11 +43,11 @@ void usage(void) { - fprintf(stderr, "usage:\n"); - fprintf(stderr, "ddb script scriptname\n"); - fprintf(stderr, "ddb script scriptname=script\n"); - fprintf(stderr, "ddb scripts\n"); - fprintf(stderr, "ddb unscript scriptname\n"); + fprintf(stderr, "usage: ddb script scriptname\n"); + fprintf(stderr, " ddb script scriptname=script\n"); + fprintf(stderr, " ddb scripts\n"); + fprintf(stderr, " ddb unscript scriptname\n"); + fprintf(stderr, " ddb pathname\n"); exit(EX_USAGE); } -- cgit v1.1