


PDX(1)		    UNIX Programmer's Manual		   PDX(1)



NAME
     pdx - pascal debugger

SYNOPSIS
     pdx [-r] [_o_b_j_f_i_l_e]

DESCRIPTION
     _P_d_x is a tool for source level debugging and execution of
     Pascal programs.  The _o_b_j_f_i_l_e is an object file produced by
     the Pascal translator _p_i(1).  If no _o_b_j_f_i_l_e is specified,
     _p_d_x looks for a file named ``obj'' in the current directory.
     The object file contains a symbol table which includes the
     name of the all the source files translated by _p_i to create
     it.  These files are available for perusal while using the
     debugger.

     If the file ``.pdxinit'' exists in the current directory,
     then the debugger commands in it are executed.

     The -r option causes the _o_b_j_f_i_l_e to be executed immediately;
     if it terminates successfully _p_d_x exits.  Otherwise it
     reports the reason for termination and offers the user the
     option of entering the debugger or simply letting _p_x con-
     tinue with a traceback.  If -r is not specified, _p_d_x just
     prompts and waits for a command.

     The commands are:

     run [_a_r_g_s] [< _f_i_l_e_n_a_m_e] [> _f_i_l_e_n_a_m_e]
	  Start executing _o_b_j_f_i_l_e, passing _a_r_g_s as command line
	  arguments; < or > can be used to redirect input or out-
	  put in the usual manner.

     trace [in _p_r_o_c_e_d_u_r_e/_f_u_n_c_t_i_o_n] [if _c_o_n_d_i_t_i_o_n]
     trace _s_o_u_r_c_e-_l_i_n_e-_n_u_m_b_e_r [if _c_o_n_d_i_t_i_o_n]
     trace _p_r_o_c_e_d_u_r_e/_f_u_n_c_t_i_o_n [in _p_r_o_c_e_d_u_r_e/_f_u_n_c_t_i_o_n] [if _c_o_n_d_i_t_i_o_n]
     trace _e_x_p_r_e_s_s_i_o_n at _s_o_u_r_c_e-_l_i_n_e-_n_u_m_b_e_r [if _c_o_n_d_i_t_i_o_n]
     trace _v_a_r_i_a_b_l_e [in _p_r_o_c_e_d_u_r_e/_f_u_n_c_t_i_o_n] [if _c_o_n_d_i_t_i_o_n]
	  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 delete com-
	  mand).

	  The first argument describes what is to be traced.  If
	  it is a _s_o_u_r_c_e-_l_i_n_e-_n_u_m_b_e_r, 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 and a colon, e.g.
	  ``mumble.p:17''.

	  If the argument is a procedure or function name then
	  every time it is called, information is printed telling



Printed 11/26/99	 April 29, 1985                         1






PDX(1)		    UNIX Programmer's Manual		   PDX(1)



	  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 an _e_x_p_r_e_s_s_i_o_n with an at clause then
	  the value of the expression is printed whenever the
	  identified source line is reached.

	  If the argument is a variable then the name and value
	  of the variable is printed whenever it changes.  Execu-
	  tion is substantially slower during this form of trac-
	  ing.

	  If no argument is specified then all source lines are
	  printed before they are executed.  Execution is sub-
	  stantially slower during this form of tracing.

	  The clause ``in _p_r_o_c_e_d_u_r_e/_f_u_n_c_t_i_o_n'' restricts tracing
	  information to be printed only while executing inside
	  the given procedure or function.

	  _C_o_n_d_i_t_i_o_n is a Pascal boolean expression and is
	  evaluated prior to printing the tracing information; if
	  it is false then the information is not printed.

	  There is no restriction on the amount of information
	  that can be traced.

     stop if _c_o_n_d_i_t_i_o_n
     stop at _s_o_u_r_c_e-_l_i_n_e-_n_u_m_b_e_r [if _c_o_n_d_i_t_i_o_n]
     stop in _p_r_o_c_e_d_u_r_e/_f_u_n_c_t_i_o_n [if _c_o_n_d_i_t_i_o_n]
     stop _v_a_r_i_a_b_l_e [if _c_o_n_d_i_t_i_o_n]
	  Stop execution when the given line is reached, pro-
	  cedure or function called, variable changed, or condi-
	  tion true.

     delete _c_o_m_m_a_n_d-_n_u_m_b_e_r
	  The trace or stop corresponding to the given number is
	  removed.  The numbers associated with traces and stops
	  are printed by the status command.

     status [> _f_i_l_e_n_a_m_e]
	  Print out the currently active trace and stop commands.

     cont Continue execution from where it stopped.  This can
	  only be done when the program was stopped by an inter-
	  rupt or through use of the stop command.

     step Execute one source line.

     next Execute up to the next source line.  The difference



Printed 11/26/99	 April 29, 1985                         2






PDX(1)		    UNIX Programmer's Manual		   PDX(1)



	  between this and step is that if the line contains a
	  call to a procedure or function the step command will
	  stop at the beginning of that block, while the next
	  command will not.

     print _e_x_p_r_e_s_s_i_o_n [, _e_x_p_r_e_s_s_i_o_n ...]
	  Print out the values of the Pascal expressions.  Vari-
	  ables declared in an outer block but having the same
	  identifier as one in the current block may be refer-
	  enced as ``_b_l_o_c_k-_n_a_m_e . _v_a_r_i_a_b_l_e''.

     whatis _i_d_e_n_t_i_f_i_e_r
	  Print the declaration of the given identifier.

     which _i_d_e_n_t_i_f_i_e_r
	  Print the full qualification of the given identifer,
	  i.e.	the outer blocks that the identifier is associ-
	  ated with.

     assign _v_a_r_i_a_b_l_e _e_x_p_r_e_s_s_i_o_n
	  Assign the value of the expression to the variable.

     call _p_r_o_c_e_d_u_r_e(_p_a_r_a_m_e_t_e_r_s)
	  Execute the object code associated with the named pro-
	  cedure or function.

     help Print out a synopsis of _p_d_x commands.

     gripe
	  Invokes a mail program to send a message to the person
	  in charge of _p_d_x.

     where
	  Print out a list of the active procedures and functions
	  and the respective source line where they are called.

     source _f_i_l_e_n_a_m_e
	  Read _p_d_x commands from the given _f_i_l_e_n_a_m_e.  Especially
	  useful when the _f_i_l_e_n_a_m_e has been created by redirect-
	  ing a status command from an earlier debugging session.

     dump [> _f_i_l_e_n_a_m_e]
	  Print the names and values of all active data.

     list [_s_o_u_r_c_e-_l_i_n_e-_n_u_m_b_e_r [, _s_o_u_r_c_e-_l_i_n_e-_n_u_m_b_e_r]]
     list _p_r_o_c_e_d_u_r_e/_f_u_n_c_t_i_o_n
	  List the lines in the current source file from the
	  first line number to the second inclusive.  As in the
	  editor ``$'' can be used to refer to the last line.  If
	  no lines are specified, the entire file is listed.  If
	  the name of a procedure or function is given lines _n-_k
	  to _n+_k are listed where _n is the first statement in the



Printed 11/26/99	 April 29, 1985                         3






PDX(1)		    UNIX Programmer's Manual		   PDX(1)



	  procedure or function and _k is small.

     file [_f_i_l_e_n_a_m_e]
	  Change the current source file name to _f_i_l_e_n_a_m_e.  If
	  none is specified then the current source file name is
	  printed.

     edit [_f_i_l_e_n_a_m_e]
     edit _p_r_o_c_e_d_u_r_e/_f_u_n_c_t_i_o_n-_n_a_m_e
	  Invoke an editor on _f_i_l_e_n_a_m_e or the current source file
	  if none is specified.  If a _p_r_o_c_e_d_u_r_e or _f_u_n_c_t_i_o_n 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 over-
	  ridden by setting the environment variable EDITOR to
	  the name of the desired editor.

     pi   Recompile the program and read in the new symbol table
	  information.

     sh _c_o_m_m_a_n_d-_l_i_n_e
	  Pass the command line to the shell for execution.  The
	  SHELL environment variable determines which shell is
	  used.

     alias _n_e_w-_c_o_m_m_a_n_d-_n_a_m_e _o_l_d-_c_o_m_m_a_n_d-_n_a_m_e
	  This command makes _p_d_x respond to _n_e_w-_c_o_m_m_a_n_d-_n_a_m_e the
	  way it used to respond to _o_l_d-_c_o_m_m_a_n_d-_n_a_m_e.

     quit Exit _p_d_x.





     The following commands deal with the program at the _p_x
     instruction level rather than source level.  They are not
     intended for general use.

     tracei [_a_d_d_r_e_s_s] [if _c_o_n_d]
     tracei [_v_a_r_i_a_b_l_e] [at _a_d_d_r_e_s_s] [if _c_o_n_d]
     stopi [_a_d_d_r_e_s_s] [if _c_o_n_d]
     stopi [at] [_a_d_d_r_e_s_s] [if _c_o_n_d]
	  Turn on tracing or set a stop using a _p_x machine
	  instruction addresses.

     xi _a_d_d_r_e_s_s [, _a_d_d_r_e_s_s]
	  Print the instructions starting at the first _a_d_d_r_e_s_s.
	  Instructions up to the second _a_d_d_r_e_s_s are printed.

     xd _a_d_d_r_e_s_s [, _a_d_d_r_e_s_s]
	  Print in octal the specified data location(s).



Printed 11/26/99	 April 29, 1985                         4






PDX(1)		    UNIX Programmer's Manual		   PDX(1)



FILES
     obj		      Pascal object file
     .pdxinit		      _P_d_x initialization file


SEE ALSO
     pi(1), px(1)
     _A_n _I_n_t_r_o_d_u_c_t_i_o_n _t_o _P_d_x

BUGS
     _P_d_x does not understand sets, and provides no information
     about files.

     The _w_h_a_t_i_s command doesn't quite work for variant records.

     Bad things will happen if a procedure invoked with the call
     command does a non-local goto.

     The commands step and next should be able to take a _c_o_u_n_t
     that specifies how many lines to execute.

     There should be commands stepi and nexti that correspond to
     step and next but work at the instruction level.

     There should be a way to get an address associated with a
     line number, procedure or function, and variable.

     Most of the command names are too long.

     The alias facility is quite weak.

     A _c_s_h-like history capability would improve the situation.























Printed 11/26/99	 April 29, 1985                         5



