implement $unsafecall (4.3BSD-reno/pgrm/3)
[unix-history] / usr / src / old / dbx / dbx.1
CommitLineData
b5dc1377 1.\" Copyright (c) 1983, 1990 The Regents of the University of California.
8a90f3aa 2.\" All rights reserved.
0b6ba29a 3.\"
b5dc1377 4.\" %sccs.include.redist.man%
8a90f3aa 5.\"
5325ced3 6.\" @(#)dbx.1 6.5 (Berkeley) %G%
0b6ba29a 7.\"
b5dc1377
CL
8.Dd
9.Dt DBX 1
10.Os BSD 4.2
11.Sh NAME
12.Nm dbx
13.Nd debugger
14.Sh SYNOPSIS
15.Nm Dbx
16.Op Fl r
17.Op Fl i
18.Op Fl k
19.Op Fl I Ar dir
20.Op Fl c Ar file
21.Op Ar objfile Op Ar coredump
22.Sh DESCRIPTION
5325ced3 23.Nm Dbx
b5dc1377 24is a tool for source level debugging and execution of
0b6ba29a 25programs under UNIX.
b5dc1377
CL
26The
27.Ar objfile
28is an object file produced by a compiler
29with the appropriate flag (usually
30.Fl g )
0b6ba29a 31specified to produce symbol information in the object file.
b5dc1377
CL
32Currently,
33.Xr cc 1 ,
34.Xr f77 1 ,
35.Xr pc 1 ,
36and the DEC Western
37Research Laboratory Modula-2 compiler,
38.Xr mod l ,
81ddc115 39produce the appropriate source information.
b5dc1377
CL
40The machine level facilities of
41.Nm dbx
0b6ba29a 42can be used on any program.
b5dc1377 43.Pp
5325ced3 44The object file contains a symbol table that includes the names of
0b6ba29a
KM
45all the source files translated by the compiler to create it.
46These files are available for perusal while using the debugger.
b5dc1377 47.Pp
5325ced3
CL
48If a file named
49.Pa core
b5dc1377
CL
50exists in the current directory
51or a
52.Ar coredump
53file is specified,
54.Nm dbx
55can be used
0b6ba29a 56to examine the state of the program when it faulted.
b5dc1377 57.Pp
5325ced3
CL
58If the file
59.Pa .dbxinit
60exists in the current directory then the
0b6ba29a 61debugger commands in it are executed.
b5dc1377 62.Nm Dbx
5325ced3
CL
63also checks for a
64.Pa .dbxinit
65in the user's home directory
0b6ba29a 66if there isn't one in the current directory.
b5dc1377 67.Pp
0b6ba29a 68The command line options and their meanings are:
b5dc1377
CL
69.Tw Fl
70.Tp Fl r
71Execute
72.Ar objfile
73immediately.
74If it terminates successfully
75.Nm dbx
76exits.
0b6ba29a
KM
77Otherwise the reason for termination will be reported
78and the user offered the option of entering the debugger
79or letting the program fault.
b5dc1377 80.Nm Dbx
5325ced3
CL
81will read from
82.Pa /dev/tty
83when
b5dc1377
CL
84.Fl r
85is specified
0b6ba29a 86and standard input is not a terminal.
b5dc1377
CL
87.Tp Fl i
88Force
89.Nm dbx
90to act as though standard input is a terminal.
91.Tp Fl k
81ddc115 92Map memory addresses, useful for kernel debugging.
b5dc1377
CL
93.Tp Cx Fl I
94.Cx \&\ \&
95.Ar dir
96.Cx
97Add
98.Ar dir
99to the list of directories
0b6ba29a 100that are searched when looking for a source file.
b5dc1377
CL
101Normally
102.Nm dbx
103looks for source files in the current directory
104and in the directory where
105.Ar objfile
106is located.
107The directory search path can also be set with the
5325ced3 108.Ic use
b5dc1377
CL
109command.
110.Tp Cx Fl c
111.Cx \&\ \&
112.Ar file
113.Cx
114Execute the
115.Nm dbx
116commands in the
117.Ar file
118before
81ddc115 119reading from standard input.
b5dc1377
CL
120.Tp
121.Pp
122Unless
123.Fl r
124is specified,
125.Nm dbx
126just prompts and waits for a command.
127.Ss Execution and Tracing Commands
128.Dw Fl
129.Di L
130.Dp Cx Ic run
131.Cx \&\ \&
132.Op Ar args
133.Cx \&\ \&
134.Op Sy < Ar filename
135.Cx \&\ \&
136.Op Sy > Ar filename
137.Cx
138.Dp Cx Ic rerun
139.Cx \&\ \&
140.Op Ar args
141.Cx \&\ \&
142.Op Sy < Ar filename
143.Cx \&\ \&
144.Op Sy > Ar filename
145.Cx
146Start executing
147.Ar objfile ,
148passing
149.Ar args
150as command line arguments;
151.Sy <
152or
153.Sy >
154can be used to redirect input or output in the usual manner.
155When
156.Ic rerun
157is used without any arguments the previous
81ddc115 158argument list is passed to the program;
b5dc1377
CL
159otherwise it is identical to
160.Ic run .
161If
162.Ar objfile
163has been written since the last time the symbolic information
164was read in,
165.Nm dbx
166will read in the new information.
167.Dp Cx Ic trace
168.Cx \&\ \&
169.Op Ic in Ar procedure/function
170.Cx \&\ \&
171.Op Ic if Ar condition
172.Cx
173.Dp Cx Ic trace
174.Cx \&\ \&
175.Ar source-line-number
176.Cx \&\ \&
177.Op Ic if Ar condition
178.Cx
179.Dp Cx Ic trace
180.Cx \&\ \&
181.Ar procedure/function
182.Cx \&\ \&
183.Op Ic in Ar procedure/function
184.Cx \&\ \&
185.Op Ic if Ar condition
186.Cx
187.Dp Cx Ic trace
188.Cx \&\ \&
189.Ar expression
190.Cx \&\ \&
191.Ic at
192.Cx \&\ \&
193.Ar source-line-number
194.Cx \&\ \&
195.Op Ic if Ar condition
196.Cx
197.Dp Cx Ic trace
198.Cx \&\ \&
199.Ar variable
200.Cx \&\ \&
201.Op Ic in Ar procedure/function
202.Cx \&\ \&
203.Op Ic if Ar condition
204.Cx
0b6ba29a
KM
205Have tracing information printed when the program is executed.
206A number is associated with the command that is used
b5dc1377
CL
207to turn the tracing off (see the
208.Ic delete
209command).
210.Pp
0b6ba29a 211The first argument describes what is to be traced.
b5dc1377
CL
212If it is a
213.Ar source-line-number ,
214then the line is printed
0b6ba29a
KM
215immediately prior to being executed.
216Source line numbers in a file other than the current one
217must be preceded by the name of the file in quotes and a colon, e.g.
218"mumble.p":17.
b5dc1377 219.Pp
0b6ba29a
KM
220If the argument is a procedure or function name then
221every time it is called, information is printed telling
222what routine called it, from what source line it was called,
223and what parameters were passed to it.
224In addition, its return is noted, and if it's a function
225then the value it is returning is also printed.
b5dc1377
CL
226.Pp
227If the argument is an
228.Ar expression
229with an
230.Ic at
231clause
0b6ba29a
KM
232then the value of the expression is printed whenever the
233identified source line is reached.
b5dc1377 234.Pp
0b6ba29a
KM
235If the argument is a variable then the name and value of the variable
236is printed whenever it changes.
237Execution is substantially slower during this form of tracing.
b5dc1377 238.Pp
0b6ba29a
KM
239If no argument is specified then all source lines are printed
240before they are executed.
241Execution is substantially slower during this form of tracing.
b5dc1377
CL
242.Pp
243The clause
244.Ic in
245.Ar procedure/function
246restricts tracing information
0b6ba29a
KM
247to be printed only while executing inside the given procedure
248or function.
b5dc1377
CL
249.Pp
250.Ar Condition
251is a boolean expression and is
0b6ba29a
KM
252evaluated prior to printing the tracing information;
253if it is false then the information is not printed.
b5dc1377
CL
254.Dp Cx Ic stop if
255.Cx \&\ \&
256.Ar condition
257.Cx
258.Dp Cx Ic stop at
259.Cx \&\ \&
260.Ar source-line-number
261.Cx \&\ \&
262.Op Ic if Ar condition
263.Cx
264.Dp Cx Ic stop in
265.Cx \&\ \&
266.Ar source-line-number
267.Cx \&\ \&
268.Op Ic if Ar condition
269.Cx
270.Dp Cx Ic stop
271.Cx \&\ \&
272.Ar variable
273.Cx \&\ \&
274.Op Ic if Ar condition
275.Cx
0b6ba29a
KM
276Stop execution when the given line is reached, procedure or function
277called, variable changed, or condition true.
b5dc1377
CL
278.Dp Cx Ic status
279.Cx \&\ \&
280.Op Ic \&> Ar filename
281.Cx
282Print out the currently active
283.Ic trace
284and
285.Ic stop
286commands.
287.Dp Cx Ic delete
288.Cx \&\ \&
289.Ar command-number ...
290.Cx
81ddc115 291The traces or stops corresponding to the given numbers are removed.
0b6ba29a 292The numbers associated with traces and stops are printed by
b5dc1377
CL
293the
294.Ic status
295command.
296.Dp Cx Ic catch
297.Cx \&\ \&
298.Ar number
299.Cx
300.Dp Cx Ic catch
301.Cx \&\ \&
302.Ar signal-name
303.Cx
304.Dp Cx Ic ignore
305.Cx \&\ \&
306.Ar number
307.Cx
308.Dp Cx Ic ignore
309.Cx \&\ \&
310.Ar signal-name
311.Cx
81ddc115 312Start or stop trapping a signal before it is sent
0b6ba29a
KM
313to the program.
314This is useful when a program being debugged
315handles signals such as interrupts.
81ddc115
KM
316A signal may be specified by number or by a name
317(e.g., SIGINT).
318Signal names are case insensitive and the ``SIG'' prefix is optional.
319By default all signals are trapped except SIGCONT, SIGCHILD,
0b6ba29a 320SIGALRM and SIGKILL.
b5dc1377
CL
321.Dp Cx Ic cont
322.Cx \&\ \&
323.Ar integer
324.Cx
325.Dp Cx Ic cont
326.Cx \&\ \&
327.Ar signal-name
328.Cx
0b6ba29a 329Continue execution from where it stopped.
81ddc115
KM
330If a signal is specified, the process continues as though
331it received the signal.
332Otherwise, the process is continued as though it had not been stopped.
b5dc1377 333.Pp
0b6ba29a
KM
334Execution cannot be continued if the process has ``finished'',
335that is, called the standard procedure ``exit''.
b5dc1377
CL
336.Nm Dbx
337does not allow the process to exit, thereby
0b6ba29a 338letting the user to examine the program state.
b5dc1377 339.Dp Ic step
0b6ba29a 340Execute one source line.
b5dc1377 341.Dp Ic next
0b6ba29a 342Execute up to the next source line.
b5dc1377
CL
343The difference between this and
344.Ic step
345is that
0b6ba29a 346if the line contains a call to a procedure or function
b5dc1377
CL
347the
348.Ic step
349command will stop at the beginning of that
350block, while the
351.Ic next
352command will not.
353.Dp Cx Ic return
354.Cx \&\ \&
355.Op Ar procedure
356.Cx
357Continue until a return to
358.Ar procedure
359is executed, or
81ddc115 360until the current procedure returns if none is specified.
b5dc1377
CL
361.Dp Cx Ic call
362.Cx \&\ \&
363.Ar procedure (parameters )
364.Cx
81ddc115 365Execute the object code associated with the named procedure or function.
b5dc1377
CL
366.Dp
367.Ss Printing Variables and Expressions
81ddc115
KM
368Names are resolved first using the static scope of the current function,
369then using the dynamic scope if the name is not defined
370in the static scope.
371If static and dynamic searches do not yield a result,
372an arbitrary symbol is chosen and
b5dc1377 373the message
5325ced3 374.Dq Li [using Ar qualified name]
b5dc1377 375is printed.
81ddc115 376The name resolution procedure may be overridden by qualifying an identifier
b5dc1377 377with a block name, e.g.,
5325ced3 378.Dq Li module.variable
81ddc115
KM
379For C, source files are treated as modules named
380by the file name without ``.c''.
b5dc1377 381.Pp
81ddc115
KM
382Expressions are specified with an approximately
383common subset of C and Pascal (or equivalently Modula-2) syntax.
384Indirection can be denoted using either a prefix ``*'' or
385a postfix ``^'' and
b5dc1377
CL
386array expressions are subscripted by brackets
387.Cx (``
388.Op
389.Cx \'\').
390.Cx
0b6ba29a 391The field reference operator (``.'') can be used with pointers
b5dc1377 392as well as records, making the C operator ``\->'' unnecessary
0b6ba29a 393(although it is supported).
b5dc1377 394.Pp
81ddc115
KM
395Types of expressions are checked;
396the type of an expression may be overridden
b5dc1377
CL
397by using
398.Cx ``
399.Ar type-name (expression)
400.Cx \'\'.
401.Cx
81ddc115 402When there is no corresponding named type
b5dc1377
CL
403the special constructs
404.Cx ``&
405.Ar type-name
406.Cx \'\'
407.Cx
408and
409.Cx ``$$
410.Ar tag-name
411.Cx \'\'
412.Cx
81ddc115 413can be used to represent a pointer to a named type or C structure tag.
b5dc1377
CL
414.Dw Fl
415.Di L
416.Dp Cx Ic assign
417.Cx \&\ \&
418.Ar variable
419.Ic =
420.Ar expression
421.Cx
81ddc115 422Assign the value of the expression to the variable.
b5dc1377
CL
423.Dp Cx Ic dump
424.Cx \&\ \&
425.Op Ar procedure
426.Cx \&\ \&
427.Op Ic > Ar filename
428.Cx
81ddc115
KM
429Print the names and values of variables in the given procedure,
430or the current one if none is specified.
431If the procedure given is ``.'', then the all active variables
432are dumped.
b5dc1377
CL
433.Dp Cx Ic print
434.Cx \&\ \&
435.Ar expression
436.Cx \&\ \&
437.Op Ic \&, Ar expression ...
438.Cx
81ddc115 439Print out the values of the expressions.
b5dc1377
CL
440.Dp Cx Ic whatis
441.Cx \&\ \&
442.Ar name
443.Cx
0b6ba29a
KM
444Print the declaration of the given name, which may be qualified
445with block names as above.
b5dc1377
CL
446.Dp Cx Ic which
447.Cx \&\ \&
448.Ar identifier
449.Cx
0b6ba29a
KM
450Print the full qualification of the given identifer, i.e.
451the outer blocks that the identifier is associated with.
b5dc1377
CL
452.Dp Cx Ic up
453.Cx \&\ \&
454.Op Ar count
455.Cx
456.Dp Cx Ic down
457.Cx \&\ \&
458.Op Ar count
459.Cx
81ddc115 460Move the current function, which is used for resolving names,
b5dc1377
CL
461up or down the stack
462.Ar count
463levels.
464The default
465.Ar count
466is 1.
467.Dp Ic where
81ddc115 468Print out a list of the active procedures and function.
b5dc1377
CL
469.Dp Cx Ic whereis
470.Cx \&\ \&
471.Ar identifier
472.Cx
0b6ba29a
KM
473Print the full qualification of all the symbols whose
474name matches the given identifier.
475The order in which the symbols are printed is not meaningful.
5325ced3 476.Dp
b5dc1377
CL
477.Ss Accessing Source Files
478.Pp
5325ced3 479.Di L
b5dc1377
CL
480.Dp Cx Ar /regular expression
481.Op /
482.Cx
483.Dp Cx Ar ?regular expression
484.Op ?
485.Cx
81ddc115
KM
486Search forward or backward in the current source file
487for the given pattern.
b5dc1377
CL
488.Dp Cx Ic edit
489.Cx \&\ \&
490.Op Ar filename
491.Cx
492.Dp Cx Ic edit
493.Cx \&\ \&
494.Ar procedure/function-name
495.Cx
496Invoke an editor on
497.Ar filename
498or the current source file if none
0b6ba29a 499is specified.
b5dc1377
CL
500If a
501.Ar procedure
502or
503.Ar function
504name is specified,
0b6ba29a
KM
505the editor is invoked on the file that contains it.
506Which editor is invoked by default depends on the installation.
507The default can be overridden by setting the environment variable
b5dc1377
CL
508.Ev EDITOR
509to the name of the desired editor.
510.Dp Cx Ic file
511.Cx \&\ \&
512.Op Ar filename
513.Cx
514Change the current source file name to
515.Ar filename .
0b6ba29a 516If none is specified then the current source file name is printed.
b5dc1377
CL
517.Dp Cx Ic func
518.Cx \&\ \&
519.Op Ar procedure/function
520.Cx
0b6ba29a
KM
521Change the current function.
522If none is specified then print the current function.
523Changing the current function implicitly changes the current source file
524to the one that contains the function; it also changes the current scope
525used for name resolution.
b5dc1377
CL
526.Dp Cx Ic list
527.Cx \&\ \&
528.Op Ar source-line-number Op Ic \&, Ar source-line-number
529.Cx
530.Dp Cx Ic list
531.Cx \&\ \&
532.Ar procedure/function
533.Cx
0b6ba29a
KM
534List the lines in the current source file from the first line number to
535the second inclusive.
536If no lines are specified, the next 10 lines are listed.
537If the name of a procedure or function is given
b5dc1377
CL
538lines
539.Ar n-k
540to
5325ced3 541.Ar n+k
b5dc1377
CL
542are listed where
543.Ar n
544is the first statement
545in the procedure or function and
546.Ar k
547is small.
548.Dp Cx Ic use
549.Cx \&\ \&
550.Ar directory-list
551.Cx
0b6ba29a
KM
552Set the list of directories to be searched
553when looking for source files.
b5dc1377
CL
554.Dp
555.Ss Command Aliases and Variables
556.Dw Fl
557.Di L
558.Dp Cx Ic alias
559.Cx \&\ \&
560.Ar name
561.Cx \&\ \&
562.Ar name
563.Cx
564.Dp Cx Ic alias
565.Cx \&\ \&
566.Ar name
567.Cx \&\ \&
568.Ar string
569.Cx
570.Dp Cx Ic alias
571.Cx \&\ \&
572.Ar name (parameters)
573.Cx \&\ \&
574.Cx ``
575.Ar string
576.Cx \'\'
577.Cx
81ddc115 578When commands are processed,
b5dc1377 579dbx first checks to see if the word
81ddc115 580is an alias for either a command or a string.
b5dc1377 581If it is an alias, then dbx treats the input as though
81ddc115
KM
582the corresponding string (with values substituted for any parameters)
583had been entered.
584For example,
585to define an alias ``rr'' for the command ``rerun'',
586one can say
b5dc1377
CL
587.Pp
588.Dl alias rr rerun
589.Pp
81ddc115
KM
590To define an alias called ``b'' that sets a stop at a particular line
591one can say
b5dc1377
CL
592.Pp
593.Dl alias b(x) ``stop at x''
594.Pp
81ddc115 595Subsequently, the command ``b(12)'' will expand to ``stop at 12''.
b5dc1377
CL
596.Pp
597.Dp Cx Ic set
5325ced3 598.Ws
b5dc1377
CL
599.Ar name
600.Op \&= Ar expression
601.Cx
602The
603.Ic set
604command defines values for debugger variables.
81ddc115
KM
605The names of these variables cannot conflict with names in the program
606being debugged, and are expanded to the corresponding expression
607within other commands.
608The following variables have a special meaning:
b5dc1377
CL
609.Dw Ds
610.Di L
611.Dp Li $frame
612Setting this variable to an address causes dbx to use the stack frame
81ddc115
KM
613pointed to by the address for
614doing stack traces and accessing local variables.
615This facility is of particular use for kernel debugging.
b5dc1377
CL
616.Dp Li $hexchars
617.Dp Li $hexints
618.Dp Li $hexoffsets
619.Dp Li $hexstrings
620When set, dbx prints out
81ddc115
KM
621out characters, integers, offsets from registers, or character pointers
622respectively in hexadecimal.
b5dc1377 623.Dp Li $listwindow
81ddc115 624The value of this variable specifies the number
b5dc1377
CL
625of lines to list around a function or when the
626.Ic list
627command
81ddc115
KM
628is given without any parameters.
629Its default value is 10.
b5dc1377
CL
630.Dp Li $mapaddrs
631Setting (unsetting) this variable causes dbx to start (stop)
81ddc115
KM
632mapping addresses.
633As with ``$frame'', this is useful for kernel debugging.
b5dc1377
CL
634.Dp Li $unsafecall
635.Dp Li $unsafeassign
3e8dcebc
DS
636When ``$unsafecall'' is set,
637strict type checking is turned off for arguments to
b5dc1377
CL
638subroutine or function calls (
639.Ar e .g .
640in the
641.Ic call
642statement).
3e8dcebc
DS
643When ``$unsafeassign'' is set,
644strict type checking between the two sides
b5dc1377
CL
645of an
646.Ic assign
647statement is turned off.
3e8dcebc 648These variables should be used only with great care,
b5dc1377 649because they severely limit dbx's usefulness
3e8dcebc 650for detecting errors.
b5dc1377
CL
651.Dp
652.Dp Cx Ic unalias
653.Cx \&\ \&
654.Ar name
655.Cx
81ddc115 656Remove the alias with the given name.
b5dc1377
CL
657.Dp Cx Ic unset
658.Cx \&\ \&
659.Ar name
660.Cx
661Delete the debugger variable associated with
662.Ar name .
663.Dp
664.Ss Machine Level Commands
665.Dw Fl
666.Di L
667.Dp Cx Ic tracei
668.Cx \&\ \&
669.Op Ar address
670.Cx \&\ \&
671.Op .Ic if Ar cond
672.Cx
673.Dp Cx Ic tracei
674.Cx \&\ \&
675.Op Ar variable
676.Cx \&\ \&
677.Op Ic at Ar address
678.Cx \&\ \&
679.Op Ic if Ar cond
680.Cx
681.Dp Cx Ic stopi
682.Cx \&\ \&
683.Op Ar address
684.Cx \&\ \&
685.Op Ic if Ar cond
686.Cx
687.Dp Cx Ic stopi
688.Cx \&\ \&
689.Op Ic at
690.Cx \&\ \&
691.Op Ar address
692.Cx \&\ \&
693.Op Ic if Ar cond
694.Cx
0b6ba29a 695Turn on tracing or set a stop using a machine instruction address.
b5dc1377
CL
696.Dp Ic stepi
697.Dp Ic nexti
698Single step as in
699.Ic step
700or
701.Ic next ,
702but do a single instruction
0b6ba29a 703rather than source line.
b5dc1377
CL
704.Dp Cx Ar address
705.Cx \&,
706.Ar address
707.Cx \&/
708.Op Ar mode
709.Cx
710.Dp Cx Ar address
711.Cx \&/
712.Op Ar count
713.Op Ar mode
714.Cx
715Print the contents of memory starting at the first
716.Ar address
717and continuing up to the second
718.Ar address
719or until
720.Ar count
721items are printed.
81ddc115 722If the address is ``.'', the address following the one
0b6ba29a 723printed most recently is used.
b5dc1377
CL
724The
725.Ar mode
726specifies how memory is to be printed;
0b6ba29a
KM
727if it is omitted the previous mode specified is used.
728The initial mode is ``X''.
729The following modes are supported:
b5dc1377
CL
730.Dw Cm
731.Dp Cm i
0b6ba29a 732print the machine instruction
b5dc1377 733.Dp Cm d
0b6ba29a 734print a short word in decimal
b5dc1377 735.Dp Cm D
0b6ba29a 736print a long word in decimal
b5dc1377 737.Dp Cm o
0b6ba29a 738print a short word in octal
b5dc1377 739.Dp Cm O
0b6ba29a 740print a long word in octal
b5dc1377 741.Dp Cm x
0b6ba29a 742print a short word in hexadecimal
b5dc1377 743.Dp Cm X
0b6ba29a 744print a long word in hexadecimal
b5dc1377 745.Dp Cm b
0b6ba29a 746print a byte in octal
b5dc1377 747.Dp Cm c
0b6ba29a 748print a byte as a character
b5dc1377 749.Dp Cm s
0b6ba29a 750print a string of characters terminated by a null byte
b5dc1377 751.Dp Cm f
0b6ba29a 752print a single precision real number
b5dc1377 753.Dp Cm g
0b6ba29a 754print a double precision real number
b5dc1377
CL
755.Dp
756.Pp
0b6ba29a
KM
757Symbolic addresses are specified by preceding the name with an ``&''.
758Registers are denoted by ``$rN'' where N is the number of the register.
759Addresses may be expressions made up of other addresses and
760the operators ``+'', ``-'', and indirection (unary ``*'').
b5dc1377
CL
761.Dp
762.Ss Miscellaneous Commands
763.Tw Ic
764.Tp Ic gripe
765Invoke a mail program to send a message to the person in charge of
766.Nm dbx .
767.Tp Ic help
768Print out a synopsis of
769.Nm dbx
770commands.
771.Tp Ic quit
772Exit
773.Nm dbx .
774.Tp Cx Ic sh
775.Cx \&\ \&
776.Ar command-line
777.Cx
0b6ba29a
KM
778Pass the command line to the shell for execution.
779The SHELL environment variable determines which shell is used.
b5dc1377
CL
780.Tp Cx Ic source
781.Cx \&\ \&
782.Ar filename
783.Cx
784Read
785.Nm dbx
786commands from the given
787.Ar filename .
788.Tp
789.Sh ENVIRONMENT
790.Nm Dbx
5325ced3 791utilizes the following environment variables:
b5dc1377
CL
792.Ds I
793EDITOR
794HOME
795PATH
796SHELL
797.De
798.Sh FILES
799.Dw .dbxinit
800.Di L
801.Dp Pa a.out
0b6ba29a 802object file
b5dc1377 803.Dp Pa .dbxinit
0b6ba29a 804initial commands
b5dc1377
CL
805.Dp
806.Sh SEE ALSO
807.Xr cc 1 ,
808.Xr mod l ,
809.Xr f77 1 ,
810.Xr pc 1
811.Sh HISTORY
812.Nm Dbx
813appeared in 4.2 BSD.
814.Sh BUGS
815.Nm Dbx
816suffers from the same ``multiple include'' malady as did
817.Nm sdb .
0b6ba29a
KM
818If you have a program consisting of a number of object files
819and each is built from source files that include header files,
820the symbolic information for the header files is replicated in
821each object file.
822Since about one debugger start-up is done for each link,
b5dc1377
CL
823having the linker
824.Xr ld 1
825re-organize the symbol information
81ddc115 826would not save much time, though it would reduce some of the
0b6ba29a 827disk space used.
b5dc1377 828.Pp
81ddc115 829This problem is an artifact of the unrestricted semantics
0b6ba29a
KM
830of #include's in C; for example an include file can contain
831static declarations that are separate entities for each file
832in which they are included.
81ddc115
KM
833However, even with Modula-2 there is a substantial amount of duplication
834of symbol information necessary for inter-module type checking.
b5dc1377 835.Pp
3e8dcebc
DS
836Some problems remain with the support for individual languages.
837Fortran problems include:
838inability to assign to logical, logical*2, complex
839and double complex variables;
840inability to represent parameter constants
841which are not type integer or real;
842peculiar representation for the values of dummy procedures
843(the value shown for a dummy procedure is actually
844the first few bytes of the procedure text;
845to find the location of the procedure,
846use ``&'' to take the address of the variable).