converted man page
[unix-history] / usr / src / old / dbx / dbx.1
index 8feb47e..411cb1b 100644 (file)
-.\" Copyright (c) 1983 The Regents of the University of California.
+.\" Copyright (c) 1983, 1990 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" All rights reserved.
 .\"
-.\" Redistribution and use in source and binary forms are permitted
-.\" provided that the above copyright notice and this paragraph are
-.\" duplicated in all such forms and that any documentation,
-.\" advertising materials, and other materials related to such
-.\" distribution and use acknowledge that the software was developed
-.\" by the University of California, Berkeley.  The name of the
-.\" University may not be used to endorse or promote products derived
-.\" from this software without specific prior written permission.
-.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+.\" %sccs.include.redist.man%
 .\"
 .\"
-.\"    @(#)dbx.1       6.3 (Berkeley) %G%
+.\"     @(#)dbx.1      6.4 (Berkeley) %G%
 .\"
 .\"
-.TH DBX 1 ""
-.UC 5
-.ds dB dbx
-.ds DB Dbx
-.SH NAME
-dbx \- debugger
-.SH SYNOPSIS
-.B dbx
-[
-.B \-r
-] [
-.B \-i
-] [
-.B \-k
-] [
-.B \-I
-.I dir
-] [
-.B \-c
-.I file
-] [
-.I objfile
-[
-.I coredump
-]]
-.SH DESCRIPTION
-\fI\*(DB\fP is a tool for source level debugging and execution of
+.Dd 
+.Dt DBX 1
+.Os BSD 4.2
+.Sh NAME
+.Nm dbx
+.Nd debugger
+.Sh SYNOPSIS
+.Nm Dbx
+.Op Fl r
+.Op Fl i
+.Op Fl k
+.Op Fl I Ar dir
+.Op Fl c Ar file
+.Op Ar objfile Op Ar coredump
+.Sh DESCRIPTION
+.Nm dbx
+is a tool for source level debugging and execution of
 programs under UNIX.
 programs under UNIX.
-The \fIobjfile\fP is an object file produced by a compiler
-with the appropriate flag (usually ``\-g'')
+The
+.Ar objfile
+is an object file produced by a compiler
+with the appropriate flag (usually
+.Fl g )
 specified to produce symbol information in the object file.
 specified to produce symbol information in the object file.
-Currently, \fIcc\fP(1), \fIf77\fP(1), \fIpc\fP(1), and the DEC Western
-Research Laboratory Modula-2 compiler, \fImod\fP(l),
+Currently,
+.Xr cc 1 ,
+.Xr f77 1 ,
+.Xr pc 1 ,
+and the DEC Western
+Research Laboratory Modula-2 compiler,
+.Xr mod l ,
 produce the appropriate source information.
 produce the appropriate source information.
-The machine level facilities of \fI\*(dB\fP
+The machine level facilities of
+.Nm dbx
 can be used on any program.
 can be used on any program.
-.PP
+.Pp
 The object file contains a symbol table that includes the name of the
 all the source files translated by the compiler to create it.
 These files are available for perusal while using the debugger.
 The object file contains a symbol table that includes the name of the
 all the source files translated by the compiler to create it.
 These files are available for perusal while using the debugger.
-.PP
-If a file named ``core'' exists in the current directory
-or a \fIcoredump\fP file is specified, \fI\*(dB\fP can be used
+.Pp
+If a file named ``core''
+exists in the current directory
+or a
+.Ar coredump
+file is specified,
+.Nm dbx
+can be used
 to examine the state of the program when it faulted.
 to examine the state of the program when it faulted.
-.PP
-If the file ``.\*(dBinit'' exists in the current directory then the
+.Pp
+If the file ``.dbxinit'' exists in the current directory then the
 debugger commands in it are executed.
 debugger commands in it are executed.
-\fI\*(DB\fP also checks for a ``.\*(dBinit'' in the user's home directory
+.Nm Dbx
+also checks for a ``.dbxinit'' in the user's home directory
 if there isn't one in the current directory.
 if there isn't one in the current directory.
-.PP
+.Pp
 The command line options and their meanings are:
 The command line options and their meanings are:
-.nr In 8
-.in +\n(Inn
-.ta \n(Inn
-.sp 1
-.ti -\n(Inn
-\&\fB\-r\fP    \c
-Execute \fIobjfile\fP immediately.
-If it terminates successfully \fI\*(dB\fP exits.
+.Tw Fl
+.Tp Fl r
+Execute
+.Ar objfile
+immediately.
+If it terminates successfully
+.Nm dbx
+exits.
 Otherwise the reason for termination will be reported
 and the user offered the option of entering the debugger
 or letting the program fault.
 Otherwise the reason for termination will be reported
 and the user offered the option of entering the debugger
 or letting the program fault.
-\fI\*(DB\fP will read from ``/dev/tty'' when \fB\-r\fP is specified
+.Nm Dbx
+will read from ``/dev/tty'' when
+.Fl r
+is specified
 and standard input is not a terminal.
 and standard input is not a terminal.
-.sp 1
-.ti -\n(Inn
-\&\fB\-i\fP    \c
-Force \fI\*(dB\fP to act as though standard input is a terminal.
-.sp 1
-.ti -\n(Inn
-\&\fB\-k\fP    \c
+.Tp Fl i
+Force
+.Nm dbx
+to act as though standard input is a terminal.
+.Tp Fl k
 Map memory addresses, useful for kernel debugging.
 Map memory addresses, useful for kernel debugging.
-.sp 1
-.ti -\n(Inn
-\&\fB\-I\fP \fIdir\fP  \c
-Add \fIdir\fP to the list of directories
+.Tp Cx Fl I
+.Cx \&\ \&
+.Ar dir
+.Cx
+Add
+.Ar dir
+to the list of directories
 that are searched when looking for a source file.
 that are searched when looking for a source file.
-Normally \fI\*(dB\fP looks for source files in the current directory
-and in the directory where \fIobjfile\fP is located.
-The directory search path can also be set with the \fBuse\fP command.
-.sp 1
-.ti -\n(Inn
-\&\fB\-c\fP \fIfile\fP \c
-Execute the \fI\*(dB\fP commands in the \fIfile\fP before
+Normally
+.Nm dbx
+looks for source files in the current directory
+and in the directory where
+.Ar objfile
+is located.
+The directory search path can also be set with the
+.Ar use
+command.
+.Tp Cx Fl c
+.Cx \&\ \&
+.Ar file
+.Cx
+Execute the
+.Nm dbx
+commands in the
+.Ar file
+before
 reading from standard input.
 reading from standard input.
-.in -\n(Inn
-.sp 1
-.PP
-Unless \fB\-r\fP is specified, \fI\*(dB\fP just prompts and waits for a command.
-.sp 1
-.ne 8
-.B Execution and Tracing Commands
-.sp 1
-.TP
-\fBrun\fP [\fIargs\fP] [\fB<\fP \fIfilename\fP] [\fB>\fP \fIfilename\fP]
-.ns
-.TP
-\fBrerun\fP [\fIargs\fP] [\fB<\fP \fIfilename\fP] [\fB>\fP \fIfilename\fP]
-Start executing \fIobjfile\fP, passing \fIargs\fP as command line arguments;
-\fB<\fP or \fB>\fP can be used to redirect input or output in the usual manner.
-When \fBrerun\fP is used without any arguments the previous
+.Tp
+.Pp
+Unless
+.Fl r
+is specified,
+.Nm dbx
+just prompts and waits for a command.
+.Ss Execution and Tracing Commands
+.Dw Fl
+.Di L
+.Dp Cx Ic run
+.Cx \&\ \&
+.Op Ar args
+.Cx \&\ \&
+.Op Sy < Ar filename
+.Cx \&\ \&
+.Op Sy > Ar filename
+.Cx
+.Dp Cx Ic rerun
+.Cx \&\ \&
+.Op Ar args
+.Cx \&\ \&
+.Op Sy < Ar filename
+.Cx \&\ \&
+.Op Sy > Ar filename
+.Cx
+Start executing
+.Ar objfile  ,
+passing
+.Ar args
+as command line arguments;
+.Sy <
+or
+.Sy >
+can be used to redirect input or output in the usual manner.
+When
+.Ic rerun
+is used without any arguments the previous
 argument list is passed to the program;
 argument list is passed to the program;
-otherwise it is identical to \fBrun\fP.
-If \fIobjfile\fP has been written since the last time the symbolic information
-was read in, \fI\*(dB\fP will read in the new information.
-.TP
-\fBtrace\fP [\fBin\fP \fIprocedure/function\fP] [\fBif\fP \fIcondition\fP]
-.ns
-.TP
-\fBtrace\fP \fIsource-line-number\fP [\fBif\fP \fIcondition\fP]
-.ns
-.TP
-\fBtrace\fP \fIprocedure/function\fP [\fBin\fP \fIprocedure/function\fP] [\fBif\fP \fIcondition\fP]
-.ns
-.TP
-\fBtrace\fP \fIexpression\fP \fBat\fP \fIsource-line-number\fP [\fBif\fP \fIcondition\fP]
-.ns
-.TP
-\fBtrace\fP \fIvariable\fP [\fBin\fP \fIprocedure/function\fP] [\fBif\fP \fIcondition\fP]
+otherwise it is identical to
+.Ic run .
+If
+.Ar objfile
+has been written since the last time the symbolic information
+was read in,
+.Nm dbx
+will read in the new information.
+.Dp Cx Ic trace
+.Cx \&\ \&
+.Op Ic in Ar procedure/function
+.Cx \&\ \&
+.Op Ic if Ar condition
+.Cx
+.Dp Cx Ic trace
+.Cx \&\ \&
+.Ar source-line-number
+.Cx \&\ \&
+.Op Ic if Ar condition
+.Cx
+.Dp Cx Ic trace
+.Cx \&\ \&
+.Ar procedure/function
+.Cx \&\ \&
+.Op Ic in Ar procedure/function
+.Cx \&\ \&
+.Op Ic if Ar condition
+.Cx
+.Dp Cx Ic trace
+.Cx \&\ \&
+.Ar expression
+.Cx \&\ \&
+.Ic at
+.Cx \&\ \&
+.Ar source-line-number
+.Cx \&\ \&
+.Op Ic if Ar condition
+.Cx
+.Dp Cx Ic trace
+.Cx \&\ \&
+.Ar variable
+.Cx \&\ \&
+.Op Ic in Ar procedure/function
+.Cx \&\ \&
+.Op Ic if Ar condition
+.Cx
 Have tracing information printed when the program is executed.
 A number is associated with the command that is used
 Have tracing information printed when the program is executed.
 A number is associated with the command that is used
-to turn the tracing off (see the \fBdelete\fP command).
-.sp 1
+to turn the tracing off (see the
+.Ic delete
+command).
+.Pp
 The first argument describes what is to be traced.
 The first argument describes what is to be traced.
-If it is a \fIsource-line-number\fP, then the line is printed
+If it is a
+.Ar source-line-number ,
+then the line is printed
 immediately prior to being executed.
 Source line numbers in a file other than the current one
 must be preceded by the name of the file in quotes and a colon, e.g.
 "mumble.p":17.
 immediately prior to being executed.
 Source line numbers in a file other than the current one
 must be preceded by the name of the file in quotes and a colon, e.g.
 "mumble.p":17.
-.sp 1
+.Pp
 If the argument is a procedure or function name then
 every time it is called, information is printed telling
 what routine called it, from what source line it was called,
 and what parameters were passed to it.
 In addition, its return is noted, and if it's a function
 then the value it is returning is also printed.
 If the argument is a procedure or function name then
 every time it is called, information is printed telling
 what routine called it, from what source line it was called,
 and what parameters were passed to it.
 In addition, its return is noted, and if it's a function
 then the value it is returning is also printed.
-.sp 1
-If the argument is an \fIexpression\fP with an \fBat\fP clause
+.Pp
+If the argument is an
+.Ar expression
+with an
+.Ic at
+clause
 then the value of the expression is printed whenever the
 identified source line is reached.
 then the value of the expression is printed whenever the
 identified source line is reached.
-.sp 1
+.Pp
 If the argument is a variable then the name and value of the variable
 is printed whenever it changes.
 Execution is substantially slower during this form of tracing.
 If the argument is a variable then the name and value of the variable
 is printed whenever it changes.
 Execution is substantially slower during this form of tracing.
-.sp 1
+.Pp
 If no argument is specified then all source lines are printed
 before they are executed.
 Execution is substantially slower during this form of tracing.
 If no argument is specified then all source lines are printed
 before they are executed.
 Execution is substantially slower during this form of tracing.
-.sp 1
-The clause ``\fBin\fP \fIprocedure/function\fP'' restricts tracing information
+.Pp
+The clause
+.Ic in
+.Ar procedure/function
+restricts tracing information
 to be printed only while executing inside the given procedure
 or function.
 to be printed only while executing inside the given procedure
 or function.
-.sp 1
-\fICondition\fP is a boolean expression and is
+.Pp
+.Ar Condition
+is a boolean expression and is
 evaluated prior to printing the tracing information;
 if it is false then the information is not printed.
 evaluated prior to printing the tracing information;
 if it is false then the information is not printed.
-.br
-.ne 10
-.IP "\fBstop\fP \fBif\fP \fIcondition\fP"
-.ns
-.IP "\fBstop\fP \fBat\fP \fIsource-line-number\fP [\fBif\fP \fIcondition\fP]"
-.ns
-.IP "\fBstop\fP \fBin\fP \fIprocedure/function\fP [\fBif\fP \fIcondition\fP]"
-.ns
-.IP "\fBstop\fP \fIvariable\fP [\fBif\fP \fIcondition\fP]"
+.Dp Cx Ic stop if
+.Cx \&\ \&
+.Ar condition
+.Cx
+.Dp Cx Ic stop at
+.Cx \&\ \&
+.Ar source-line-number
+.Cx \&\ \&
+.Op Ic if Ar condition
+.Cx
+.Dp Cx Ic stop in
+.Cx \&\ \&
+.Ar source-line-number
+.Cx \&\ \&
+.Op Ic if Ar condition
+.Cx
+.Dp Cx Ic stop
+.Cx \&\ \&
+.Ar variable
+.Cx \&\ \&
+.Op Ic if Ar condition
+.Cx
 Stop execution when the given line is reached, procedure or function
 called, variable changed, or condition true.
 Stop execution when the given line is reached, procedure or function
 called, variable changed, or condition true.
-.IP "\fBstatus\fP [\fB>\fP \fIfilename\fP]"
-Print out the currently active \fBtrace\fP and \fBstop\fP commands.
-.IP "\fBdelete\fP \fIcommand-number\fP ..."
+.Dp Cx Ic status
+.Cx \&\ \&
+.Op Ic \&> Ar filename
+.Cx
+Print out the currently active
+.Ic trace
+and
+.Ic stop
+commands.
+.Dp Cx Ic delete
+.Cx \&\ \&
+.Ar command-number ...
+.Cx
 The traces or stops corresponding to the given numbers are removed.
 The numbers associated with traces and stops are printed by
 The traces or stops corresponding to the given numbers are removed.
 The numbers associated with traces and stops are printed by
-the \fBstatus\fP command.
-.IP "\fBcatch\fP \fInumber\fP"
-.ns
-.IP "\fBcatch\fP \fIsignal-name\fP"
-.ns
-.IP "\fBignore\fP \fInumber\fP"
-.ns
-.IP "\fBignore\fP \fIsignal-name\fP"
+the
+.Ic status
+command.
+.Dp Cx Ic catch
+.Cx \&\ \&
+.Ar number
+.Cx
+.Dp Cx Ic catch
+.Cx \&\ \&
+.Ar signal-name
+.Cx
+.Dp Cx Ic ignore
+.Cx \&\ \&
+.Ar number
+.Cx
+.Dp Cx Ic ignore
+.Cx \&\ \&
+.Ar signal-name
+.Cx
 Start or stop trapping a signal before it is sent
 to the program.
 This is useful when a program being debugged
 Start or stop trapping a signal before it is sent
 to the program.
 This is useful when a program being debugged
@@ -204,371 +311,524 @@ A signal may be specified by number or by a name
 Signal names are case insensitive and the ``SIG'' prefix is optional.
 By default all signals are trapped except SIGCONT, SIGCHILD,
 SIGALRM and SIGKILL.
 Signal names are case insensitive and the ``SIG'' prefix is optional.
 By default all signals are trapped except SIGCONT, SIGCHILD,
 SIGALRM and SIGKILL.
-.IP "\fBcont\fP \fIinteger\fP"
-.ns
-.IP "\fBcont\fP \fIsignal-name\fP"
+.Dp Cx Ic cont
+.Cx \&\ \&
+.Ar integer
+.Cx
+.Dp Cx Ic cont
+.Cx \&\ \&
+.Ar signal-name
+.Cx
 Continue execution from where it stopped.
 If a signal is specified, the process continues as though
 it received the signal.
 Otherwise, the process is continued as though it had not been stopped.
 Continue execution from where it stopped.
 If a signal is specified, the process continues as though
 it received the signal.
 Otherwise, the process is continued as though it had not been stopped.
-.PP
+.Pp
 Execution cannot be continued if the process has ``finished'',
 that is, called the standard procedure ``exit''.
 Execution cannot be continued if the process has ``finished'',
 that is, called the standard procedure ``exit''.
-\fI\*(DB\fP does not allow the process to exit, thereby
+.Nm Dbx
+does not allow the process to exit, thereby
 letting the user to examine the program state.
 letting the user to examine the program state.
-.IP \fBstep\fP
+.Dp Ic step
 Execute one source line.
 Execute one source line.
-.IP \fBnext\fP
+.Dp Ic next
 Execute up to the next source line.
 Execute up to the next source line.
-The difference between this and \fBstep\fP is that
+The difference between this and
+.Ic step
+is that
 if the line contains a call to a procedure or function
 if the line contains a call to a procedure or function
-the \fBstep\fP command will stop at the beginning of that
-block, while the \fBnext\fP command will not.
-.IP "\fBreturn\fP [\fIprocedure\fP]"
-Continue until a return to \fIprocedure\fP is executed, or
+the
+.Ic step
+command will stop at the beginning of that
+block, while the
+.Ic next
+command will not.
+.Dp Cx Ic return
+.Cx \&\ \&
+.Op Ar procedure
+.Cx
+Continue until a return to
+.Ar procedure
+is executed, or
 until the current procedure returns if none is specified.
 until the current procedure returns if none is specified.
-.IP "\fBcall\fP \fIprocedure(parameters)\fP"
+.Dp Cx Ic call
+.Cx \&\ \&
+.Ar procedure (parameters )
+.Cx
 Execute the object code associated with the named procedure or function.
 Execute the object code associated with the named procedure or function.
-.sp 1
-.br
-.ne 8v
-.PP
-.B Printing Variables and Expressions
-.sp 1
-.PP
+.Dp
+.Ss Printing Variables and Expressions
 Names are resolved first using the static scope of the current function,
 then using the dynamic scope if the name is not defined
 in the static scope.
 If static and dynamic searches do not yield a result,
 an arbitrary symbol is chosen and
 Names are resolved first using the static scope of the current function,
 then using the dynamic scope if the name is not defined
 in the static scope.
 If static and dynamic searches do not yield a result,
 an arbitrary symbol is chosen and
-the message ``[using\ \fIqualified\ name\fP]'' is printed.
+the message
+.Cx ``
+.Op using Ar qualified name
+.Cx \'\'
+.Cx
+is printed.
 The name resolution procedure may be overridden by qualifying an identifier
 The name resolution procedure may be overridden by qualifying an identifier
-with a block name, e.g., ``\fImodule\fP.\fIvariable\fP''.
+with a block name, e.g.,
+.Cx ``
+Ar module.variable
+.Cx \'\'.
+.Cx
 For C, source files are treated as modules named
 by the file name without ``.c''.
 For C, source files are treated as modules named
 by the file name without ``.c''.
-.PP
+.Pp
 Expressions are specified with an approximately
 common subset of C and Pascal (or equivalently Modula-2) syntax.
 Indirection can be denoted using either a prefix ``*'' or
 a postfix ``^'' and
 Expressions are specified with an approximately
 common subset of C and Pascal (or equivalently Modula-2) syntax.
 Indirection can be denoted using either a prefix ``*'' or
 a postfix ``^'' and
-array expressions are subscripted by brackets (``[ ]'').
+array expressions are subscripted by brackets
+.Cx (``
+.Op
+.Cx \'\').
+.Cx
 The field reference operator (``.'') can be used with pointers
 The field reference operator (``.'') can be used with pointers
-as well as records, making the C operator ``->'' unnecessary
+as well as records, making the C operator ``\->'' unnecessary
 (although it is supported).
 (although it is supported).
-.PP
+.Pp
 Types of expressions are checked;
 the type of an expression may be overridden
 Types of expressions are checked;
 the type of an expression may be overridden
-by using ``\fItype-name\fP(\fIexpression\fP)''.
+by using
+.Cx ``
+.Ar type-name (expression)
+.Cx \'\'.
+.Cx
 When there is no corresponding named type
 When there is no corresponding named type
-the special constructs ``&\fItype-name\fP'' and ``$$\fItag-name\fP''
+the special constructs
+.Cx ``&
+.Ar type-name
+.Cx \'\'
+.Cx
+and
+.Cx ``$$
+.Ar tag-name
+.Cx \'\'
+.Cx
 can be used to represent a pointer to a named type or C structure tag.
 can be used to represent a pointer to a named type or C structure tag.
-.sp 1
-.IP "\fBassign\fP \fIvariable\fP \fB=\fP \fIexpression\fP"
+.Dw Fl
+.Di L
+.Dp Cx Ic assign
+.Cx \&\ \&
+.Ar variable
+.Ic =
+.Ar expression
+.Cx
 Assign the value of the expression to the variable.
 Assign the value of the expression to the variable.
-.IP "\fBdump\fP [\fIprocedure\fR] [\fB>\fP \fIfilename\fP]"
+.Dp Cx Ic dump
+.Cx \&\ \&
+.Op Ar procedure
+.Cx \&\ \&
+.Op Ic > Ar filename
+.Cx
 Print the names and values of variables in the given procedure,
 or the current one if none is specified.
 If the procedure given is ``.'', then the all active variables
 are dumped.
 Print the names and values of variables in the given procedure,
 or the current one if none is specified.
 If the procedure given is ``.'', then the all active variables
 are dumped.
-.IP "\fBprint\fP \fIexpression\fP [\fB,\fP \fIexpression\fP ...]"
+.Dp Cx Ic print
+.Cx \&\ \&
+.Ar expression
+.Cx \&\ \&
+.Op Ic \&, Ar expression ...
+.Cx
 Print out the values of the expressions.
 Print out the values of the expressions.
-.IP "\fBwhatis\fP \fIname\fP"
+.Dp Cx Ic whatis
+.Cx \&\ \&
+.Ar name
+.Cx
 Print the declaration of the given name, which may be qualified
 with block names as above.
 Print the declaration of the given name, which may be qualified
 with block names as above.
-.IP "\fBwhich\fP \fIidentifier\fP"
+.Dp Cx Ic which
+.Cx \&\ \&
+.Ar identifier
+.Cx
 Print the full qualification of the given identifer, i.e.
 the outer blocks that the identifier is associated with.
 Print the full qualification of the given identifer, i.e.
 the outer blocks that the identifier is associated with.
-.IP "\fBup\fP [\fIcount\fP]"
-.ns
-.IP "\fBdown\fP [\fIcount\fP]"
+.Dp Cx Ic up
+.Cx \&\ \&
+.Op Ar count
+.Cx
+.Dp Cx Ic down
+.Cx \&\ \&
+.Op Ar count
+.Cx
 Move the current function, which is used for resolving names,
 Move the current function, which is used for resolving names,
-up or down the stack \fIcount\fP levels.
-The default \fIcount\fP is 1.
-.IP \fBwhere\fP
+up or down the stack
+.Ar count
+levels.
+The default
+.Ar count
+is 1.
+.Dp Ic where
 Print out a list of the active procedures and function.
 Print out a list of the active procedures and function.
-.IP "\fBwhereis\fP \fIidentifier\fP"
+.Dp Cx Ic whereis
+.Cx \&\ \&
+.Ar identifier
+.Cx
 Print the full qualification of all the symbols whose
 name matches the given identifier.
 The order in which the symbols are printed is not meaningful.
 Print the full qualification of all the symbols whose
 name matches the given identifier.
 The order in which the symbols are printed is not meaningful.
-.sp 1
-.br
-.ne 8v
-.PP
-.B Accessing Source Files
-.sp 1
-.IP "/\fIregular\ expression\fP[/]"
-.ns
-.IP "?\fIregular\ expression\fP[?]"
+.Ss Accessing Source Files
+.Pp
+.Dp Cx Ar /regular expression
+.Op /
+.Cx
+.Dp Cx Ar ?regular expression
+.Op ?
+.Cx
 Search forward or backward in the current source file
 for the given pattern.
 Search forward or backward in the current source file
 for the given pattern.
-.IP "\fBedit\fP [\fIfilename\fP]"
-.ns
-.IP "\fBedit\fP \fIprocedure/function-name\fP"
-Invoke an editor on \fIfilename\fP or the current source file if none
+.Dp Cx Ic edit
+.Cx \&\ \&
+.Op Ar filename
+.Cx
+.Dp Cx Ic edit
+.Cx \&\ \&
+.Ar procedure/function-name
+.Cx
+Invoke an editor on
+.Ar filename
+or the current source file if none
 is specified.
 is specified.
-If a \fIprocedure\fP or \fIfunction\fP name is specified,
+If a
+.Ar procedure
+or
+.Ar function
+name is specified,
 the editor is invoked on the file that contains it.
 Which editor is invoked by default depends on the installation.
 The default can be overridden by setting the environment variable
 the editor is invoked on the file that contains it.
 Which editor is invoked by default depends on the installation.
 The default can be overridden by setting the environment variable
-EDITOR to the name of the desired editor.
-.IP "\fBfile\fP [\fIfilename\fP]"
-Change the current source file name to \fIfilename\fP.
+.Ev EDITOR
+to the name of the desired editor.
+.Dp Cx Ic file
+.Cx \&\ \&
+.Op Ar filename
+.Cx
+Change the current source file name to
+.Ar filename  .
 If none is specified then the current source file name is printed.
 If none is specified then the current source file name is printed.
-.IP "\fBfunc\fP [\fIprocedure/function\fP]"
+.Dp Cx Ic func
+.Cx \&\ \&
+.Op Ar procedure/function
+.Cx
 Change the current function.
 If none is specified then print the current function.
 Changing the current function implicitly changes the current source file
 to the one that contains the function; it also changes the current scope
 used for name resolution.
 Change the current function.
 If none is specified then print the current function.
 Changing the current function implicitly changes the current source file
 to the one that contains the function; it also changes the current scope
 used for name resolution.
-.IP "\fBlist\fP [\fIsource-line-number\fP [\fB,\fP \fIsource-line-number\fP]]"
-.ns
-.IP "\fBlist\fP \fIprocedure/function\fP"
+.Dp Cx Ic list
+.Cx \&\ \&
+.Op Ar source-line-number Op Ic \&, Ar source-line-number
+.Cx
+.Dp Cx Ic list
+.Cx \&\ \&
+.Ar procedure/function
+.Cx
 List the lines in the current source file from the first line number to
 the second inclusive.
 If no lines are specified, the next 10 lines are listed.
 If the name of a procedure or function is given
 List the lines in the current source file from the first line number to
 the second inclusive.
 If no lines are specified, the next 10 lines are listed.
 If the name of a procedure or function is given
-lines \fIn-k\fP to \fIn+k\fP are listed where \fIn\fP is the first statement
-in the procedure or function and \fIk\fP is small.
-.IP "\fBuse\fP \fIdirectory-list\fP"
+lines
+.Ar n-k
+to
+.Ar n +k
+are listed where
+.Ar n
+is the first statement
+in the procedure or function and
+.Ar k
+is small.
+.Dp Cx Ic use
+.Cx \&\ \&
+.Ar directory-list
+.Cx
 Set the list of directories to be searched
 when looking for source files.
 Set the list of directories to be searched
 when looking for source files.
-.sp 1
-.br
-.ne 8v
-.PP
-.B Command Aliases and Variables
-.sp 1
-.TP
-\fBalias\fP \fIname\fP \fIname\fP
-.ns
-.TP
-\fBalias\fP \fIname\fP ``\fIstring\fP''
-.ns
-.TP
-\fBalias\fP \fIname\fP (\fIparameters\fP) ``\fIstring\fP''
+.Dp
+.Ss Command Aliases and Variables
+.Dw Fl
+.Di L
+.Dp Cx Ic alias
+.Cx \&\ \&
+.Ar name
+.Cx \&\ \&
+.Ar name
+.Cx
+.Dp Cx Ic alias
+.Cx \&\ \&
+.Ar name
+.Cx \&\ \&
+.Ar string
+.Cx
+.Dp Cx Ic alias
+.Cx \&\ \&
+.Ar name (parameters)
+.Cx \&\ \&
+.Cx ``
+.Ar string
+.Cx \'\'
+.Cx
 When commands are processed,
 When commands are processed,
-\*(dB first checks to see if the word
+dbx first checks to see if the word
 is an alias for either a command or a string.
 is an alias for either a command or a string.
-If it is an alias, then \*(dB treats the input as though
+If it is an alias, then dbx treats the input as though
 the corresponding string (with values substituted for any parameters)
 had been entered.
 For example,
 to define an alias ``rr'' for the command ``rerun'',
 one can say
 the corresponding string (with values substituted for any parameters)
 had been entered.
 For example,
 to define an alias ``rr'' for the command ``rerun'',
 one can say
-.sp 1
-.in +8n
-alias rr rerun
-.in -8n
-.sp 1
+.Pp
+.Dl alias rr rerun
+.Pp
 To define an alias called ``b'' that sets a stop at a particular line
 one can say
 To define an alias called ``b'' that sets a stop at a particular line
 one can say
-.sp 1
-.in +8n
-alias b(x) ``stop at x''
-.in -8n
-.sp 1
+.Pp
+.Dl alias b(x) ``stop at x''
+.Pp
 Subsequently, the command ``b(12)'' will expand to ``stop at 12''.
 Subsequently, the command ``b(12)'' will expand to ``stop at 12''.
-.need 5
-.TP
-\fBset\fP \fIname\fP [= \fIexpression\fP]
-The \fBset\fP command defines values for debugger variables.
+.Pp
+.Dp Cx Ic set
+.Ar name
+.Op \&= Ar expression
+.Cx
+The
+.Ic set
+command defines values for debugger variables.
 The names of these variables cannot conflict with names in the program
 being debugged, and are expanded to the corresponding expression
 within other commands.
 The following variables have a special meaning:
 The names of these variables cannot conflict with names in the program
 being debugged, and are expanded to the corresponding expression
 within other commands.
 The following variables have a special meaning:
-.sp 1
-.in +8n
-.ti -5n
-$frame
-.br
-Setting this variable to an address causes \*(dB to use the stack frame
+.Dw Ds
+.Di L
+.Dp Li $frame
+Setting this variable to an address causes dbx to use the stack frame
 pointed to by the address for
 doing stack traces and accessing local variables.
 This facility is of particular use for kernel debugging.
 pointed to by the address for
 doing stack traces and accessing local variables.
 This facility is of particular use for kernel debugging.
-.sp 1
-.ti -5n
-$hexchars
-.ti -5n
-$hexints
-.ti -5n
-$hexoffsets
-.ti -5n
-$hexstrings
-.br
-When set, \*(dB prints out
+.Dp Li $hexchars
+.Dp Li $hexints
+.Dp Li $hexoffsets
+.Dp Li $hexstrings
+When set, dbx prints out
 out characters, integers, offsets from registers, or character pointers
 respectively in hexadecimal.
 out characters, integers, offsets from registers, or character pointers
 respectively in hexadecimal.
-.sp 1
-.ti -5n
-$listwindow
-.br
+.Dp Li $listwindow
 The value of this variable specifies the number
 The value of this variable specifies the number
-of lines to list around a function or when the \fBlist\fP command
+of lines to list around a function or when the
+.Ic list
+command
 is given without any parameters.
 Its default value is 10.
 is given without any parameters.
 Its default value is 10.
-.sp 1
-.ti -5n
-$mapaddrs
-.br
-Setting (unsetting) this variable causes \*(dB to start (stop)
+.Dp Li $mapaddrs
+Setting (unsetting) this variable causes dbx to start (stop)
 mapping addresses.
 As with ``$frame'', this is useful for kernel debugging.
 mapping addresses.
 As with ``$frame'', this is useful for kernel debugging.
-.sp 1
-.ti -5n
-$unsafecall
-.ti -5n
-$unsafeassign
-.br
+.Dp Li $unsafecall
+.Dp Li $unsafeassign
 When ``$unsafecall'' is set,
 strict type checking is turned off for arguments to
 When ``$unsafecall'' is set,
 strict type checking is turned off for arguments to
-subroutine or function calls (\fIe.g.\fP in the \fBcall\fP statement).
+subroutine or function calls (
+.Ar e .g .
+in the
+.Ic call
+statement).
 When ``$unsafeassign'' is set,
 strict type checking between the two sides
 When ``$unsafeassign'' is set,
 strict type checking between the two sides
-of an \fBassign\fP statement is turned off.
+of an
+.Ic assign
+statement is turned off.
 These variables should be used only with great care,
 These variables should be used only with great care,
-because they severely limit \*(dB's usefulness
+because they severely limit dbx's usefulness
 for detecting errors.
 for detecting errors.
-.in -8n
-.TP
-\fBunalias\fP \fIname\fP
+.Dp
+.Dp Cx Ic unalias
+.Cx \&\ \&
+.Ar name
+.Cx
 Remove the alias with the given name.
 Remove the alias with the given name.
-.TP
-\fBunset\fP \fIname\fP
-Delete the debugger variable associated with \fIname\fP.
-.sp 1
-.br
-.ne 8v
-.PP
-.B Machine Level Commands
-.sp 1
-.TP
-\fBtracei\fP [\fIaddress\fP] [\fBif\fP \fIcond\fP]
-.ns
-.TP
-\fBtracei\fP [\fIvariable\fP] [\fBat\fP \fIaddress\fP] [\fBif\fP \fIcond\fP]
-.ns
-.TP
-\fBstopi\fP [\fIaddress\fP] [\fBif\fP \fIcond\fP]
-.ns
-.TP
-\fBstopi\fP [\fBat\fP] [\fIaddress\fP] [\fBif\fP \fIcond\fP]
+.Dp Cx Ic unset
+.Cx \&\ \&
+.Ar name
+.Cx
+Delete the debugger variable associated with
+.Ar name  .
+.Dp
+.Ss Machine Level Commands
+.Dw Fl
+.Di L
+.Dp Cx Ic tracei
+.Cx \&\ \&
+.Op Ar address
+.Cx \&\ \&
+.Op .Ic if Ar cond
+.Cx
+.Dp Cx Ic tracei
+.Cx \&\ \&
+.Op Ar variable
+.Cx \&\ \&
+.Op Ic at Ar address
+.Cx \&\ \&
+.Op Ic if Ar cond
+.Cx
+.Dp Cx Ic stopi
+.Cx \&\ \&
+.Op Ar address
+.Cx \&\ \&
+.Op Ic if Ar cond
+.Cx
+.Dp Cx Ic stopi
+.Cx \&\ \&
+.Op Ic at
+.Cx \&\ \&
+.Op Ar address
+.Cx \&\ \&
+.Op Ic if Ar cond
+.Cx
 Turn on tracing or set a stop using a machine instruction address.
 Turn on tracing or set a stop using a machine instruction address.
-.TP
-\fBstepi\fP
-.ns
-.TP
-\fBnexti\fP
-Single step as in \fBstep\fP or \fBnext\fP, but do a single instruction
+.Dp Ic stepi
+.Dp Ic nexti
+Single step as in
+.Ic step
+or
+.Ic next  ,
+but do a single instruction
 rather than source line.
 rather than source line.
-.TP
-\fIaddress\fP \fB,\fP\fIaddress\fP\fB/\fP [\fImode\fP]
-.ns
-.TP
-\fIaddress\fP \fB/\fP [\fIcount\fP] [\fImode\fP]
-Print the contents of memory starting at the first \fIaddress\fP
-and continuing up to the second \fIaddress\fP or until \fIcount\fP items are printed.
+.Dp Cx Ar address
+.Cx \&,
+.Ar address
+.Cx \&/
+.Op Ar mode
+.Cx
+.Dp Cx Ar address
+.Cx \&/
+.Op Ar count
+.Op Ar mode
+.Cx
+Print the contents of memory starting at the first
+.Ar address
+and continuing up to the second
+.Ar address
+or until
+.Ar count
+items are printed.
 If the address is ``.'', the address following the one
 printed most recently is used.
 If the address is ``.'', the address following the one
 printed most recently is used.
-The \fImode\fP specifies how memory is to be printed;
+The
+.Ar mode
+specifies how memory is to be printed;
 if it is omitted the previous mode specified is used.
 The initial mode is ``X''.
 The following modes are supported:
 if it is omitted the previous mode specified is used.
 The initial mode is ``X''.
 The following modes are supported:
-.nr In 5
-.in +\n(Inn
-.ta \n(Inn
-.sp 1
-.ti -\n(Inn
-\&\fBi\fP      \c
+.Dw Cm
+.Dp Cm i
 print the machine instruction
 print the machine instruction
-.ti -\n(Inn
-\&\fBd\fP      \c
+.Dp Cm d
 print a short word in decimal
 print a short word in decimal
-.ti -\n(Inn
-\&\fBD\fP      \c
+.Dp Cm D
 print a long word in decimal
 print a long word in decimal
-.ti -\n(Inn
-\&\fBo\fP      \c
+.Dp Cm o
 print a short word in octal
 print a short word in octal
-.ti -\n(Inn
-\&\fBO\fP      \c
+.Dp Cm O
 print a long word in octal
 print a long word in octal
-.ti -\n(Inn
-\&\fBx\fP      \c
+.Dp Cm x
 print a short word in hexadecimal
 print a short word in hexadecimal
-.ti -\n(Inn
-\&\fBX\fP      \c
+.Dp Cm X
 print a long word in hexadecimal
 print a long word in hexadecimal
-.ti -\n(Inn
-\&\fBb\fP      \c
+.Dp Cm b
 print a byte in octal
 print a byte in octal
-.ti -\n(Inn
-\&\fBc\fP      \c
+.Dp Cm c
 print a byte as a character
 print a byte as a character
-.ti -\n(Inn
-\&\fBs\fP      \c
+.Dp Cm s
 print a string of characters terminated by a null byte
 print a string of characters terminated by a null byte
-.ti -\n(Inn
-\&\fBf\fP      \c
+.Dp Cm f
 print a single precision real number
 print a single precision real number
-.ti -\n(Inn
-\&\fBg\fP      \c
+.Dp Cm g
 print a double precision real number
 print a double precision real number
-.in -\n(Inn
-.sp 1
-.PP
+.Dp
+.Pp
 Symbolic addresses are specified by preceding the name with an ``&''.
 Registers are denoted by ``$rN'' where N is the number of the register.
 Addresses may be expressions made up of other addresses and
 the operators ``+'', ``-'', and indirection (unary ``*'').
 Symbolic addresses are specified by preceding the name with an ``&''.
 Registers are denoted by ``$rN'' where N is the number of the register.
 Addresses may be expressions made up of other addresses and
 the operators ``+'', ``-'', and indirection (unary ``*'').
-.sp 1
-.br
-.ne 8v
-.PP
-.B Miscellaneous Commands
-.sp 1
-.IP \fBgripe\fP
-Invoke a mail program to send a message to the person in charge of \fI\*(dB\fP.
-.IP \fBhelp\fP
-Print out a synopsis of \fI\*(dB\fP commands.
-.IP "\fBquit\fP"
-Exit \fI\*(dB\fP.
-.IP "\fBsh\fP \fIcommand-line\fP"
+.Dp
+.Ss Miscellaneous Commands
+.Tw Ic
+.Tp Ic gripe
+Invoke a mail program to send a message to the person in charge of
+.Nm dbx  .
+.Tp Ic help
+Print out a synopsis of
+.Nm dbx
+commands.
+.Tp Ic quit
+Exit
+.Nm dbx  .
+.Tp Cx Ic sh
+.Cx \&\ \&
+.Ar command-line
+.Cx
 Pass the command line to the shell for execution.
 The SHELL environment variable determines which shell is used.
 Pass the command line to the shell for execution.
 The SHELL environment variable determines which shell is used.
-.TP
-\fBsource\fP \fIfilename\fP
-Read \fI\*(dB\fP commands from the given \fIfilename\fP.
-.SH FILES
-.nr In 20
-.in +\n(Inn
-.ta \n(Inn
-.sp 1
-.ti -\n(Inn
-\&a.out        \c
+.Tp Cx Ic source
+.Cx \&\ \&
+.Ar filename
+.Cx
+Read
+.Nm dbx
+commands from the given
+.Ar filename  .
+.Tp
+.Sh ENVIRONMENT
+.Nm Dbx
+checks these environment variables:
+.Ds I
+EDITOR
+HOME
+PATH
+SHELL
+.De
+.Sh FILES
+.Dw .dbxinit
+.Di L
+.Dp Pa a.out
 object file
 object file
-.ti -\n(Inn
-\&\&.\*(dBinit \c
+.Dp Pa .dbxinit
 initial commands
 initial commands
-.SH SEE ALSO
-cc(1), f77(1), pc(1), mod(l)
-.SH COMMENTS
-\fI\*(DB\fP suffers from the same ``multiple include'' malady as did \fIsdb\fP.
+.Dp
+.Sh SEE ALSO
+.Xr cc 1 ,
+.Xr mod l ,
+.Xr f77 1 ,
+.Xr pc 1
+.Sh HISTORY
+.Nm Dbx
+appeared in 4.2 BSD.
+.Sh BUGS
+.Nm Dbx
+suffers from the same ``multiple include'' malady as did
+.Nm sdb  .
 If you have a program consisting of a number of object files
 and each is built from source files that include header files,
 the symbolic information for the header files is replicated in
 each object file.
 Since about one debugger start-up is done for each link,
 If you have a program consisting of a number of object files
 and each is built from source files that include header files,
 the symbolic information for the header files is replicated in
 each object file.
 Since about one debugger start-up is done for each link,
-having the linker (ld) re-organize the symbol information
+having the linker
+.Xr ld 1
+re-organize the symbol information
 would not save much time, though it would reduce some of the
 disk space used.
 would not save much time, though it would reduce some of the
 disk space used.
-.PP
+.Pp
 This problem is an artifact of the unrestricted semantics
 of #include's in C; for example an include file can contain
 static declarations that are separate entities for each file
 in which they are included.
 However, even with Modula-2 there is a substantial amount of duplication
 of symbol information necessary for inter-module type checking.
 This problem is an artifact of the unrestricted semantics
 of #include's in C; for example an include file can contain
 static declarations that are separate entities for each file
 in which they are included.
 However, even with Modula-2 there is a substantial amount of duplication
 of symbol information necessary for inter-module type checking.
-.PP
+.Pp
 Some problems remain with the support for individual languages.
 Fortran problems include:
 inability to assign to logical, logical*2, complex
 Some problems remain with the support for individual languages.
 Fortran problems include:
 inability to assign to logical, logical*2, complex