|
|
1.1 root 1: .TH pdx 1
2: .SH NAME
3: pdx - pascal debugger
4: .SH SYNOPSIS
5: pdx [\fB-r\fP] [\fIobjfile\fP]
6: .SH DESCRIPTION
7: \fIPdx\fP is a tool for source level debugging and execution of
8: Pascal programs.
9: The \fIobjfile\fP is an object file produced by the Pascal translator \fIpi\fP(1).
10: If no \fIobjfile\fP is specified, \fIpdx\fP looks
11: for a file named ``obj'' in the current directory.
12: The object file contains a symbol table which includes the name of the
13: all the source files translated by \fIpi\fP to create it.
14: These files are available for perusal while using the debugger.
15: .PP
16: If the file ``.pdxinit'' exists in the current directory, then the
17: debugger commands in it are executed.
18: .PP
19: The \fB-r\fP option causes the \fIobjfile\fP to be executed immediately;
20: if it terminates successfully \fIpdx\fP exits.
21: Otherwise it reports the reason for termination
22: and offers the user the option of entering the debugger
23: or simply letting \fIpx\fP continue with a traceback.
24: If \fB-r\fP is not specified, \fIpdx\fP just prompts and waits for a command.
25: .PP
26: The commands are:
27: .TP
28: \fBrun\fP [\fIargs\fP] [\fB<\fP \fIfilename\fP] [\fB>\fP \fIfilename\fP]
29: Start executing \fIobjfile\fP, passing \fIargs\fP as command line arguments;
30: \fB<\fP or \fB>\fP can be used to redirect input or output in the usual manner.
31: .TP
32: \fBtrace\fP [\fBin\fP \fIprocedure/function\fP] [\fBif\fP \fIcondition\fP]
33: .ns
34: .TP
35: \fBtrace\fP \fIsource-line-number\fP [\fBif\fP \fIcondition\fP]
36: .ns
37: .TP
38: \fBtrace\fP \fIprocedure/function\fP [\fBin\fP \fIprocedure/function\fP] [\fBif\fP \fIcondition\fP]
39: .ns
40: .TP
41: \fBtrace\fP \fIexpression\fP \fBat\fP \fIsource-line-number\fP [\fBif\fP \fIcondition\fP]
42: .ns
43: .TP
44: \fBtrace\fP \fIvariable\fP [\fBin\fP \fIprocedure/function\fP] [\fBif\fP \fIcondition\fP]
45: Have tracing information printed when the program is executed.
46: A number is associated with the command that is used
47: to turn the tracing off (see the \fBdelete\fP command).
48: .sp 1
49: The first argument describes what is to be traced.
50: If it is a \fIsource-line-number\fP, then the line is printed
51: immediately prior to being executed.
52: Source line numbers in a file other than the current one
53: must be preceded by the name of the file and a colon, e.g.
54: ``mumble.p:17''.
55: .sp 1
56: If the argument is a procedure or function name then
57: every time it is called, information is printed telling
58: what routine called it, from what source line it was called,
59: and what parameters were passed to it.
60: In addition, its return is noted, and if it's a function
61: then the value it is returning is also printed.
62: .sp 1
63: If the argument is an \fIexpression\fP with an \fBat\fP clause
64: then the value of the expression is printed whenever the
65: identified source line is reached.
66: .sp 1
67: If the argument is a variable then the name and value of the variable
68: is printed whenever it changes.
69: Execution is substantially slower during this form of tracing.
70: .sp 1
71: If no argument is specified then all source lines are printed
72: before they are executed.
73: Execution is substantially slower during this form of tracing.
74: .sp 1
75: The clause ``\fBin\fP \fIprocedure/function\fP'' restricts tracing information
76: to be printed only while executing inside the given procedure
77: or function.
78: .sp 1
79: \fICondition\fP is a Pascal boolean expression and is
80: evaluated prior to printing the tracing information;
81: if it is false then the information is not printed.
82: .sp 1
83: There is no restriction on the amount of information
84: that can be traced.
85: .br
86: .ne 10
87: .IP "\fBstop\fP \fBif\fP \fIcondition\fP"
88: .ns
89: .IP "\fBstop\fP \fBat\fP \fIsource-line-number\fP [\fBif\fP \fIcondition\fP]"
90: .ns
91: .IP "\fBstop\fP \fBin\fP \fIprocedure/function\fP [\fBif\fP \fIcondition\fP]"
92: .ns
93: .IP "\fBstop\fP \fIvariable\fP [\fBif\fP \fIcondition\fP]"
94: Stop execution when the given line is reached, procedure or function
95: called, variable changed, or condition true.
96: .IP "\fBdelete\fP \fIcommand-number\fP"
97: The trace or stop corresponding to the given number is removed.
98: The numbers associated with traces and stops are printed by
99: the \fBstatus\fP command.
100: .IP "\fBstatus\fP [\fB>\fP \fIfilename\fP]"
101: Print out
102: the currently active \fBtrace\fP and \fBstop\fP commands.
103: .IP \fBcont\fP
104: Continue execution from where it stopped.
105: This can only be
106: done when the program was stopped by an interrupt
107: or through use of the \fBstop\fP command.
108: .IP \fBstep\fP
109: Execute one source line.
110: .IP \fBnext\fP
111: Execute up to the next source line.
112: The difference between this and \fBstep\fP is that
113: if the line contains a call to a procedure or function
114: the \fBstep\fP command will stop at the beginning of that
115: block, while the \fBnext\fP command will not.
116: .IP "\fBprint\fP \fIexpression\fP [\fB,\fP \fIexpression\fP ...]"
117: Print out the values of the Pascal expressions.
118: Variables declared in an outer block but having
119: the same identifier as one in the current block may be
120: referenced as ``\fIblock-name\fP\ \fB.\fP\ \fIvariable\fP''.
121: .IP "\fBwhatis\fP \fIidentifier\fP"
122: Print the declaration of the given identifier.
123: .IP "\fBwhich\fP \fIidentifier\fP"
124: Print the full qualification of the given identifer, i.e.
125: the outer blocks that the identifier is associated with.
126: .IP "\fBassign\fP \fIvariable\fP \fIexpression\fP"
127: Assign the value of the expression to the variable.
128: .IP "\fBcall\fP \fIprocedure(parameters)\fP"
129: Execute the object code associated with the named procedure or function.
130: .IP \fBhelp\fP
131: Print out a synopsis of \fIpdx\fP commands.
132: .IP \fBgripe\fP
133: Invokes a mail program to send a message to the person in charge of \fIpdx\fP.
134: .IP \fBwhere\fP
135: Print out
136: a list of the active procedures and functions and the respective source
137: line where they are called.
138: .TP
139: \fBsource\fP \fIfilename\fP
140: Read \fIpdx\fP commands from the given \fIfilename\fP.
141: Especially useful when the \fIfilename\fP has been created by redirecting
142: a \fBstatus\fP command from an earlier debugging session.
143: .IP "\fBdump\fP [\fB>\fP \fIfilename\fP]"
144: Print the names and values of all active
145: data.
146: .IP "\fBlist\fP [\fIsource-line-number\fP [\fB,\fP \fIsource-line-number\fP]]"
147: .ns
148: .IP "\fBlist\fP \fIprocedure/function\fP"
149: List the lines in the current source file from the first line number to
150: the second inclusive.
151: As in the editor
152: ``$'' can be used to refer to the last line.
153: If no lines are specified, the entire file is listed.
154: If the name of a procedure or function is given
155: lines \fIn-k\fP to \fIn+k\fP are listed where \fIn\fP is the first statement
156: in the procedure or function and \fIk\fP is small.
157: .IP "\fBfile\fP [\fIfilename\fP]"
158: Change the current source file name to \fIfilename\fP.
159: If none is specified then the current source file name is printed.
160: .IP "\fBedit\fP [\fIfilename\fP]"
161: .ns
162: .IP "\fBedit\fP \fIprocedure/function-name\fP"
163: Invoke an editor on \fIfilename\fP or the current source file if none
164: is specified.
165: If a \fIprocedure\fP or \fIfunction\fP name is specified,
166: the editor is invoked on the file that contains it.
167: Which editor is invoked by default depends on the installation.
168: The default can be overridden by setting the environment variable
169: EDITOR to the name of the desired editor.
170: .IP \fBpi\fP
171: Recompile the program and read in the new symbol table information.
172: .IP "\fBsh\fP \fIcommand-line\fP"
173: Pass the command line to the shell for execution.
174: The SHELL environment variable determines which shell is used.
175: .IP "\fBalias\fP \fInew-command-name\fP \fIold-command-name\fP"
176: This command makes \fIpdx\fP respond to \fInew-command-name\fP
177: the way it used to respond to \fIold-command-name\fP.
178: .IP "\fBquit\fP"
179: Exit \fIpdx\fP.
180: .sp 4
181: .PP
182: The following commands deal with the program at the \fIpx\fP instruction
183: level rather than source level.
184: They are not intended for general use.
185: .TP
186: \fBtracei\fP [\fIaddress\fP] [\fBif\fP \fIcond\fP]
187: .ns
188: .TP
189: \fBtracei\fP [\fIvariable\fP] [\fBat\fP \fIaddress\fP] [\fBif\fP \fIcond\fP]
190: .ns
191: .TP
192: \fBstopi\fP [\fIaddress\fP] [\fBif\fP \fIcond\fP]
193: .ns
194: .TP
195: \fBstopi\fP [\fBat\fP] [\fIaddress\fP] [\fBif\fP \fIcond\fP]
196: Turn on tracing or set a stop using a \fIpx\fP machine
197: instruction addresses.
198: .TP
199: \fBxi\fP \fIaddress\fP [\fB,\fP \fIaddress\fP]
200: Print the instructions starting at the first \fIaddress\fP.
201: Instructions up to
202: the second \fIaddress\fP are printed.
203: .TP
204: \fBxd\fP \fIaddress\fP [\fB,\fP \fIaddress\fP]
205: Print in octal the specified data location(s).
206: .SH FILES
207: .nr In 25
208: .in +\n(Inn
209: .ta \n(Inn
210: .br
211: .nr wg 1v
212: .ie \n(.h=\n(vk .nr wg -\n(vhu
213: .el .nr vh 0
214: .if \n(wg>0 \{\
215: .sp \n(wgu
216: .nr vh +\n(wgu \}
217: .nr vk \n(.h
218: .ti -\n(Inn
219: \&obj \c
220: Pascal object file
221: .br
222: .nr wg 0v
223: .ie \n(.h=\n(vk .nr wg -\n(vhu
224: .el .nr vh 0
225: .if \n(wg>0 \{\
226: .sp \n(wgu
227: .nr vh +\n(wgu \}
228: .nr vk \n(.h
229: .ti -\n(Inn
230: \&\&.pdxinit \c
231: \fIPdx\fP initialization file
232: .in -\n(Inn
233: .br
234: .nr wg 1v
235: .ie \n(.h=\n(vk .nr wg -\n(vhu
236: .el .nr vh 0
237: .if \n(wg>0 \{\
238: .sp \n(wgu
239: .nr vh +\n(wgu \}
240: .nr vk \n(.h
241: .SH SEE ALSO
242: pi(1), px(1)
243: .br
244: \fIAn Introduction to Pdx\fP
245: .SH BUGS
246: \fIPdx\fP does not understand sets,
247: and provides no information about files.
248: .sp 1
249: The \fIwhatis\fP command doesn't quite work for variant records.
250: .sp 1
251: Bad things will happen if a procedure invoked with
252: the \fBcall\fP command does a non-local goto.
253: .sp 1
254: The commands \fBstep\fP and \fBnext\fP should be able to take a \fIcount\fP
255: that specifies how many lines to execute.
256: .sp 1
257: There should be commands \fBstepi\fP and \fBnexti\fP that correspond
258: to \fBstep\fP and \fBnext\fP but work at the instruction level.
259: .sp 1
260: There should be a way to get an address associated with
261: a line number, procedure or function, and variable.
262: .sp 1
263: Most of the command names are too long.
264: .sp 1
265: The alias facility is quite weak.
266: .sp 1
267: A \fIcsh\fP-like history capability would improve the situation.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.