|
|
1.1 root 1: .\" Copyright (c) 1983, 1990 The Regents of the University of California.
2: .\" All rights reserved.
3: .\"
4: .\" Redistribution and use in source and binary forms are permitted provided
5: .\" that: (1) source distributions retain this entire copyright notice and
6: .\" comment, and (2) distributions including binaries display the following
7: .\" acknowledgement: ``This product includes software developed by the
8: .\" University of California, Berkeley and its contributors'' in the
9: .\" documentation or other materials provided with the distribution and in
10: .\" all advertising materials mentioning features or use of this software.
11: .\" Neither the name of the University nor the names of its contributors may
12: .\" be used to endorse or promote products derived from this software without
13: .\" specific prior written permission.
14: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
15: .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
16: .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17: .\"
18: .\" @(#)pdx.1 6.2 (Berkeley) 6/11/90
19: .\"
20: .Dd June 11, 1990
21: .Dt PDX 1
22: .Os BSD 4.2
23: .Sh NAME
24: .Nm pdx
25: .Nd pascal debugger
26: .Sh SYNOPSIS
27: .Nm pdx
28: .Op Fl r
29: .Op Ar objfile
30: .Sh DESCRIPTION
31: .Nm Pdx
32: is a tool for source level debugging and execution of
33: Pascal programs.
34: The
35: .Ar objfile
36: is an object file produced by the Pascal translator
37: .Xr pi 1 .
38: If no
39: .Ar objfile
40: is specified,
41: .Nm pdx
42: looks
43: for a file named ``obj'' in the current directory.
44: The object file contains a symbol table which includes the name of the
45: all the source files translated by
46: .Xr pi 1
47: to create it.
48: These files are available for perusal while using the debugger.
49: .Pp
50: If the file
51: .Dq Pa .pdxinit
52: exists in the current directory, then the
53: debugger commands in it are executed.
54: .Pp
55: .Tp Fl r
56: The
57: .Fl r
58: option causes the
59: .Ar objfile
60: to be executed immediately;
61: if it terminates successfully
62: .Nm pdx
63: exits.
64: Otherwise it reports the reason for termination
65: and offers the user the option of entering the debugger
66: or simply letting
67: .Xr px
68: continue with a traceback.
69: If
70: .Fl r
71: is not specified,
72: .Nm pdx
73: just prompts and waits for a command.
74: .Tp
75: .Pp
76: The commands are:
77: .Dw Fl
78: .Di L
79: .Dp Cx Ic run
80: .Cx \&\ \&
81: .Op Ar args
82: .Cx \&\ \&
83: .Op Ic \&< Ar filename
84: .Cx \&\ \&
85: .Op Ic \&> Ar filename
86: .Cx
87: Start executing
88: .Ar objfile ,
89: passing
90: .Ar args
91: as command line arguments;
92: .Ic \&<
93: or
94: .Ic \&>
95: can be used to redirect input or output in the usual manner.
96: .Pp
97: .Dp Cx Ic trace
98: .Pp
99: .Cx \&\ \&
100: .Op Ic in Ar procedure/function
101: .Cx \&\ \&
102: .Op Ic if Ar condition
103: .Cx
104: .Dp Cx Ic trace
105: .Cx \&\ \&
106: .Ar source-line-number
107: .Op Ic if Ar condition
108: .Cx \&\ \&
109: .Cx
110: .Dp Cx Ic trace
111: .Cx \&\ \&
112: .Ar procedure/function
113: .Cx \&\ \&
114: .Op Ic in Ar procedure/function
115: .Cx \&\ \&
116: .Op Ic if Ar condition
117: .Cx
118: .Dp Cx Ic trace
119: .Cx \&\ \&
120: .Ar expression
121: .Cx \&\ \&
122: .Ic at
123: .Cx \&\ \&
124: .Ar source-line-number
125: .Cx \&\ \&
126: .Op Ic if Ar condition
127: .Cx
128: .Dp Cx Ic trace
129: .Cx \&\ \&
130: .Ar variable
131: .Cx \&\ \&
132: .Op Ic in Ar procedure/function
133: .Cx \&\ \&
134: .Op Ic if Ar condition
135: .Cx
136: Have tracing information printed when the program is executed.
137: A number is associated with the command that is used
138: to turn the tracing off (see the
139: .Ic delete
140: command).
141: .Pp
142: The first argument describes what is to be traced.
143: If it is a
144: .Ar source-line-number ,
145: then the line is printed
146: immediately prior to being executed.
147: Source line numbers in a file other than the current one
148: must be preceded by the name of the file and a colon, e.g.
149: ``mumble.p:17''.
150: .Pp
151: If the argument is a procedure or function name then
152: every time it is called, information is printed telling
153: what routine called it, from what source line it was called,
154: and what parameters were passed to it.
155: In addition, its return is noted, and if it's a function
156: then the value it is returning is also printed.
157: .Pp
158: If the argument is an
159: .Ar expression
160: with an
161: .Ic at
162: clause
163: then the value of the expression is printed whenever the
164: identified source line is reached.
165: .Pp
166: If the argument is a variable then the name and value of the variable
167: is printed whenever it changes.
168: Execution is substantially slower during this form of tracing.
169: .Pp
170: If no argument is specified then all source lines are printed
171: before they are executed.
172: Execution is substantially slower during this form of tracing.
173: .Pp
174: The clause
175: .Dq Cx Ic in
176: .Cx \&\ \&
177: .Ar procedure/function
178: .Cx
179: restricts tracing information
180: to be printed only while executing inside the given procedure
181: or function.
182: .Pp
183: .Ar Condition
184: is a Pascal boolean expression and is
185: evaluated prior to printing the tracing information;
186: if it is false then the information is not printed.
187: .Pp
188: There is no restriction on the amount of information
189: that can be traced.
190: .Pp
191: .ne 10
192: .Dp Cx Ic stop
193: .Cx \&\ \&
194: .Ic if
195: .Cx \&\ \&
196: .Ar condition
197: .Cx
198: .Dp Cx Ic stop
199: .Cx \&\ \&
200: .Ic at
201: .Cx \&\ \&
202: .Ar source-line-number
203: .Cx \&\ \&
204: .Op Ic if Ar condition
205: .Cx
206: .Dp Cx Ic stop
207: .Cx \&\ \&
208: .Ic in
209: .Cx \&\ \&
210: .Ar procedure /function
211: .Cx \&\ \&
212: .Op Ic if Ar condition
213: .Cx
214: .Dp Cx Ic stop
215: .Cx \&\ \&
216: .Ar variable
217: .Cx \&\ \&
218: .Op Ic if Ar condition
219: .Cx
220: Stop execution when the given line is reached, procedure or function
221: called, variable changed, or condition true.
222: .Pp
223: .Dp Cx Ic delete
224: .Cx \&\ \&
225: .Ar command-number
226: .Cx
227: The trace or stop corresponding to the given number is removed.
228: The numbers associated with traces and stops are printed by
229: the
230: .Ic status
231: command.
232: .Pp
233: .Dp Cx Ic status
234: .Cx \&\ \&
235: .Op Ic \&> Ar filename
236: .Cx
237: Print out
238: the currently active
239: .Ic trace
240: and
241: .Ic stop
242: commands.
243: .Pp
244: .Dp Ic cont
245: Continue execution from where it stopped.
246: This can only be
247: done when the program was stopped by an interrupt
248: or through use of the
249: .Ic stop
250: command.
251: .Pp
252: .Dp Ic step
253: Execute one source line.
254: .Pp
255: .Dp Ic next
256: Execute up to the next source line.
257: The difference between this and
258: .Ic step
259: is that
260: if the line contains a call to a procedure or function
261: the
262: .Ic step
263: command will stop at the beginning of that
264: block, while the
265: .Ic next
266: command will not.
267: .Pp
268: .Dp Cx Ic print
269: .Cx \&\ \&
270: .Ar expression
271: .Cx \&\ \&
272: .Op Ic \&, Ar expression ...
273: .Cx
274: Print out the values of the Pascal expressions.
275: Variables declared in an outer block but having
276: the same identifier as one in the current block may be
277: referenced as
278: .Dq Ar block-name \&. variable
279: .Pp
280: .Dp Cx Ic whatis
281: .Cx \&\ \&
282: .Ar identifier
283: .Cx
284: Print the declaration of the given identifier.
285: .Pp
286: .Dp Cx Ic which
287: .Cx \&\ \&
288: .Ar identifier
289: .Cx
290: Print the full qualification of the given identifer, i.e.
291: the outer blocks that the identifier is associated with.
292: .Pp
293: .Dp Cx Ic assign
294: .Cx \&\ \&
295: .Ar variable
296: .Cx \&\ \&
297: .Ar expression
298: .Cx
299: Assign the value of the expression to the variable.
300: .Pp
301: .Dp Cx Ic call
302: .Cx \&\ \&
303: .Ar procedure (parameters)
304: .Cx
305: Execute the object code associated with the named procedure or function.
306: .Pp
307: .Dp Ic help
308: Print out a synopsis of
309: .Nm pdx
310: commands.
311: .Pp
312: .Dp Ic gripe
313: Invokes a mail program to send a message to the person in charge of
314: .Nm pdx .
315: .Pp
316: .Dp Ic where
317: Print out
318: a list of the active procedures and functions and the respective source
319: line where they are called.
320: .Pp
321: .Dp Cx Ic source
322: .Cx \&\ \&
323: .Ar filename
324: .Cx
325: Read
326: .Nm pdx
327: commands from the given
328: .Ar filename .
329: Especially useful when the
330: .Ar filename
331: has been created by redirecting
332: a
333: .Ic status
334: command from an earlier debugging session.
335: .Pp
336: .Dp Cx Ic dump
337: .Cx \&\ \&
338: .Op Ic \&> Ar filename
339: .Cx
340: Print the names and values of all active
341: data.
342: .Pp
343: .Dp Cx Ic list
344: .Cx \&\ \&[
345: .Ar source-line-number
346: .Cx \&\ \&
347: .Op \&, Ar source-line-number
348: .Cx \&]
349: .Cx
350: .Dp Cx Ic list
351: .Cx \&\ \&
352: .Ar procedure/function
353: .Cx
354: List the lines in the current source file from the first line number to
355: the second inclusive.
356: As in the editor
357: ``$'' can be used to refer to the last line.
358: If no lines are specified, the entire file is listed.
359: If the name of a procedure or function is given
360: lines
361: .Ar n-k
362: to
363: .Ar n+k
364: are listed where
365: .Ar n
366: is the first statement
367: in the procedure or function and
368: .Ar k
369: is small.
370: .Pp
371: .Dp Cx Ic file
372: .Cx \&\ \&
373: .Op Ar filename
374: .Cx
375: Change the current source file name to
376: .Ar filename .
377: If none is specified then the current source file name is printed.
378: .Pp
379: .Dp Cx Ic edit
380: .Cx \&\ \&
381: .Op Ar filename
382: .Cx
383: .Dp Cx Ic edit
384: .Cx \&\ \&
385: .Ar procedure/function-name
386: .Cx
387: Invoke an editor on
388: .Ar filename
389: or the current source file if none
390: is specified.
391: If a
392: .Ar procedure
393: or
394: .Ar function
395: name is specified,
396: the editor is invoked on the file that contains it.
397: Which editor is invoked by default depends on the installation.
398: The default can be overridden by setting the environment variable
399: EDITOR to the name of the desired editor.
400: .Pp
401: .Dp Ic pi
402: Recompile the program and read in the new symbol table information.
403: .Pp
404: .Dp Cx Ic sh
405: .Cx \&\ \&
406: .Ar command-line
407: .Cx
408: Pass the command line to the shell for execution.
409: The SHELL environment variable determines which shell is used.
410: .Pp
411: .Dp Cx Ic alias
412: .Cx \&\ \&
413: .Ar new-command-name
414: .Cx \&\ \&
415: .Ar old-command-name
416: .Cx
417: This command makes
418: .Nm pdx
419: respond to
420: .Ar new-command-name
421: the way it used to respond to
422: .Ar old-command-name .
423: .Pp
424: .Dp Ic quit
425: Exit
426: .Nm pdx .
427: .Dp
428: .Pp
429: The following commands deal with the program at the
430: .Ar px
431: instruction
432: level rather than source level.
433: They are not intended for general use.
434: .Dw Fl
435: .Di L
436: .Dp Cx Ic tracei
437: .Cx \&\ \&
438: .Op Ar address
439: .Cx \&\ \&
440: .Op Ic if Ar cond
441: .Cx
442: .Dp Cx Ic tracei
443: .Cx \&\ \&
444: .Op Ar variable
445: .Cx \&\ \&
446: .Op Ic at Ar address
447: .Cx \&\ \&
448: .Op Ic if Ar cond
449: .Cx
450: .Dp Cx Ic stopi
451: .Cx \&\ \&
452: .Op Ar address
453: .Cx \&\ \&
454: .Op Ic if Ar cond
455: .Cx
456: .Dp Cx Ic stopi
457: .Cx \&\ \&
458: .Op Ic at
459: .Cx \&\ \&
460: .Op Ar address
461: .Cx \&\ \&
462: .Op Ic if Ar cond
463: .Cx
464: Turn on tracing or set a stop using a
465: .Ic px
466: machine
467: instruction addresses.
468: .Pp
469: .Dp Cx Ic xi
470: .Cx \&\ \&
471: .Ar address
472: .Cx \&\ \&
473: .Op Ic \&, Ar address
474: .Cx
475: Print the instructions starting at the first
476: .Ar address .
477: Instructions up to
478: the second
479: .Ar address
480: are printed.
481: .Pp
482: .Dp Cx Ic xd
483: .Cx \&\ \&
484: .Ar address
485: .Cx \&\ \&
486: .Op Ic \&, Ar address
487: .Cx
488: Print in octal the specified data location(s).
489: .Dp
490: .Sh ENVIRONMENT
491: .Tw Ar
492: .Tp Ev EDITOR
493: The
494: .Ic edit
495: function uses the
496: .Ev EDITOR
497: environment variable to see what editor to use.
498: .Tp Ev SHELL
499: The function
500: .Ic sh
501: checks the
502: .Ev SHELL
503: variable to see which shell to
504: execute.
505: .Tp
506: .Sh FILES
507: .Dw .pdxinit
508: .Di L
509: .Dp Pa \&obj
510: Pascal object file
511: .Dp Pa \&.pdxinit
512: .Nm Pdx
513: initialization file
514: .Dp
515: .Sh SEE ALSO
516: .Xr pi 1 ,
517: .Xr px 1
518: .br
519: .Em Ar An Introduction to Pdx
520: .Sh HISTORY
521: .Nm Pdx
522: appeared in 4.2 BSD.
523: .Sh BUGS
524: .Nm Pdx
525: does not understand sets,
526: and provides no information about files.
527: .Pp
528: The
529: .Ic whatis
530: command doesn't quite work for variant records.
531: .Pp
532: Bad things will happen if a procedure invoked with
533: the
534: .Ic call
535: command does a non-local goto.
536: .Pp
537: The commands
538: .Ic step
539: and
540: .Ic next
541: should be able to take a
542: .Ar count
543: that specifies how many lines to execute.
544: .Pp
545: There should be commands
546: .Ic stepi
547: and
548: .Ic nexti
549: that correspond
550: to
551: .Ic step
552: and
553: .Ic next
554: but work at the instruction level.
555: .Pp
556: There should be a way to get an address associated with
557: a line number, procedure or function, and variable.
558: .Pp
559: Most of the command names are too long.
560: .Pp
561: The alias facility is quite weak.
562: .Pp
563: A
564: .Xr csh 1
565: \- 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.