1PDX(1)                      General Commands Manual                     PDX(1)
2
3
4

NAME

6       pdx - pascal debugger
7

SYNOPSIS

9       pdx [-r] [objfile]
10

DESCRIPTION

12       Pdx  is  a tool for source level debugging and execution of Pascal pro‐
13       grams.  The objfile is an object file produced by the Pascal translator
14       pi(1).   If no objfile is specified, pdx looks for a file named ``obj''
15       in the current directory.  The object  file  contains  a  symbol  table
16       which includes the name of the all the source files translated by pi to
17       create it.  These files are  available  for  perusal  while  using  the
18       debugger.
19
20       If  the  file  ``.pdxinit''  exists  in the current directory, then the
21       debugger commands in it are executed.
22
23       The -r option causes the objfile to be executed immediately; if it ter‐
24       minates  successfully  pdx  exits.  Otherwise it reports the reason for
25       termination and offers the user the option of entering the debugger  or
26       simply  letting  px continue with a traceback.  If -r is not specified,
27       pdx just prompts and waits for a command.
28
29       The commands are:
30
31       run [args] [< filename] [> filename]
32              Start executing objfile, passing args as command line arguments;
33              < or > can be used to redirect input or output in the usual man‐
34              ner.
35
36       trace [in procedure/function] [if condition]
37       trace source-line-number [if condition]
38       trace procedure/function [in procedure/function] [if condition]
39       trace expression at source-line-number [if condition]
40       trace variable [in procedure/function] [if condition]
41              Have tracing information printed when the program  is  executed.
42              A number is associated with the command that is used to turn the
43              tracing off (see the delete command).
44
45              The first argument describes what is to be traced.  If it  is  a
46              source-line-number,  then  the line is printed immediately prior
47              to being executed.  Source line numbers in a file other than the
48              current  one  must  be  preceded  by  the name of the file and a
49              colon, e.g.  ``mumble.p:17''.
50
51              If the argument is a procedure or function name then every  time
52              it is called, information is printed telling what routine called
53              it, from what source line it was  called,  and  what  parameters
54              were  passed  to  it.   In addition, its return is noted, and if
55              it's a function then the value it is returning is also printed.
56
57              If the argument is an expression with  an  at  clause  then  the
58              value  of  the  expression  is  printed  whenever the identified
59              source line is reached.
60
61              If the argument is a variable then the name  and  value  of  the
62              variable  is printed whenever it changes.  Execution is substan‐
63              tially slower during this form of tracing.
64
65              If no argument is specified then all source  lines  are  printed
66              before  they  are  executed.   Execution is substantially slower
67              during this form of tracing.
68
69              The clause ``in procedure/function'' restricts tracing  informa‐
70              tion  to be printed only while executing inside the given proce‐
71              dure or function.
72
73              Condition is a Pascal boolean expression and is evaluated  prior
74              to  printing  the  tracing  information; if it is false then the
75              information is not printed.
76
77              There is no restriction on the amount of information that can be
78              traced.
79
80       stop if condition
81       stop at source-line-number [if condition]
82       stop in procedure/function [if condition]
83       stop variable [if condition]
84              Stop  execution  when  the  given  line is reached, procedure or
85              function called, variable changed, or condition true.
86
87       delete command-number
88              The trace or stop corresponding to the given number is  removed.
89              The  numbers associated with traces and stops are printed by the
90              status command.
91
92       status [> filename]
93              Print out the currently active trace and stop commands.
94
95       cont   Continue execution from where it stopped.  This can only be done
96              when  the  program was stopped by an interrupt or through use of
97              the stop command.
98
99       step   Execute one source line.
100
101       next   Execute up to the next source line.  The difference between this
102              and  step  is that if the line contains a call to a procedure or
103              function the step command will stop at  the  beginning  of  that
104              block, while the next command will not.
105
106       print expression [, expression ...]
107              Print  out  the  values  of  the  Pascal expressions.  Variables
108              declared in an outer block but having the same identifier as one
109              in  the  current block may be referenced as ``block-name . vari‐
110              able''.
111
112       whatis identifier
113              Print the declaration of the given identifier.
114
115       which identifier
116              Print the full qualification of the given identifer,  i.e.   the
117              outer blocks that the identifier is associated with.
118
119       assign variable expression
120              Assign the value of the expression to the variable.
121
122       call procedure(parameters)
123              Execute  the  object code associated with the named procedure or
124              function.
125
126       help   Print out a synopsis of pdx commands.
127
128       gripe  Invokes a mail program to send a message to the person in charge
129              of pdx.
130
131       where  Print  out a list of the active procedures and functions and the
132              respective source line where they are called.
133
134       source filename
135              Read pdx commands from the given  filename.   Especially  useful
136              when  the filename has been created by redirecting a status com‐
137              mand from an earlier debugging session.
138
139       dump [> filename]
140              Print the names and values of all active data.
141
142       list [source-line-number [, source-line-number]]
143       list procedure/function
144              List the lines in the current source file from  the  first  line
145              number  to  the second inclusive.  As in the editor ``$'' can be
146              used to refer to the last line.  If no lines are specified,  the
147              entire  file  is listed.  If the name of a procedure or function
148              is given lines n-k to n+k are listed where n is the first state‐
149              ment in the procedure or function and k is small.
150
151       file [filename]
152              Change  the  current  source  file name to filename.  If none is
153              specified then the current source file name is printed.
154
155       edit [filename]
156       edit procedure/function-name
157              Invoke an editor on filename or the current source file if  none
158              is specified.  If a procedure or function name is specified, the
159              editor is invoked on the file that contains it.  Which editor is
160              invoked by default depends on the installation.  The default can
161              be overridden by setting the environment variable EDITOR to  the
162              name of the desired editor.
163
164       pi     Recompile  the program and read in the new symbol table informa‐
165              tion.
166
167       sh command-line
168              Pass the command line to the shell  for  execution.   The  SHELL
169              environment variable determines which shell is used.
170
171       alias new-command-name old-command-name
172              This  command  makes  pdx respond to new-command-name the way it
173              used to respond to old-command-name.
174
175       quit   Exit pdx.
176
177
178
179
180
181       The following commands deal with the  program  at  the  px  instruction
182       level rather than source level.  They are not intended for general use.
183
184       tracei [address] [if cond]
185       tracei [variable] [at address] [if cond]
186       stopi [address] [if cond]
187       stopi [at] [address] [if cond]
188              Turn  on  tracing  or  set a stop using a px machine instruction
189              addresses.
190
191       xi address [, address]
192              Print the instructions starting at the first address.   Instruc‐
193              tions up to the second address are printed.
194
195       xd address [, address]
196              Print in octal the specified data location(s).
197

FILES

199       obj                      Pascal object file
200       .pdxinit                 Pdx initialization file
201
202

SEE ALSO

204       pi(1), px(1)
205       An Introduction to Pdx
206

BUGS

208       Pdx does not understand sets, and provides no information about files.
209
210       The whatis command doesn't quite work for variant records.
211
212       Bad  things  will  happen  if a procedure invoked with the call command
213       does a non-local goto.
214
215       The commands step and next should be able to take a count  that  speci‐
216       fies how many lines to execute.
217
218       There  should  be  commands stepi and nexti that correspond to step and
219       next but work at the instruction level.
220
221       There should be a way to get an address associated with a line  number,
222       procedure or function, and variable.
223
224       Most of the command names are too long.
225
226       The alias facility is quite weak.
227
228       A csh-like history capability would improve the situation.
229
230
231
2324.2 Berkeley Distribution       April 29, 1985                          PDX(1)
Impressum