4.3BSD-Tahoe/usr/man/cat1/pdx.0

Compare this file to the similar file:
Show the results in this format:




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



NNAAMMEE
     pdx - pascal debugger

SSYYNNOOPPSSIISS
     pdx [--rr] [_o_b_j_f_i_l_e]

DDEESSCCRRIIPPTTIIOONN
     _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 --rr 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 --rr is not specified, _p_d_x just
     prompts and waits for a command.

     The commands are:

     rruunn [_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.

     ttrraaccee [iinn _p_r_o_c_e_d_u_r_e/_f_u_n_c_t_i_o_n] [iiff _c_o_n_d_i_t_i_o_n]
     ttrraaccee _s_o_u_r_c_e-_l_i_n_e-_n_u_m_b_e_r [iiff _c_o_n_d_i_t_i_o_n]
     ttrraaccee _p_r_o_c_e_d_u_r_e/_f_u_n_c_t_i_o_n [iinn _p_r_o_c_e_d_u_r_e/_f_u_n_c_t_i_o_n] [iiff _c_o_n_d_i_t_i_o_n]
     ttrraaccee _e_x_p_r_e_s_s_i_o_n aatt _s_o_u_r_c_e-_l_i_n_e-_n_u_m_b_e_r [iiff _c_o_n_d_i_t_i_o_n]
     ttrraaccee _v_a_r_i_a_b_l_e [iinn _p_r_o_c_e_d_u_r_e/_f_u_n_c_t_i_o_n] [iiff _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 ddeelleettee 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 7/9/88		 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 aatt 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 ``iinn _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.

     ssttoopp iiff _c_o_n_d_i_t_i_o_n
     ssttoopp aatt _s_o_u_r_c_e-_l_i_n_e-_n_u_m_b_e_r [iiff _c_o_n_d_i_t_i_o_n]
     ssttoopp iinn _p_r_o_c_e_d_u_r_e/_f_u_n_c_t_i_o_n [iiff _c_o_n_d_i_t_i_o_n]
     ssttoopp _v_a_r_i_a_b_l_e [iiff _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.

     ddeelleettee _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 ssttaattuuss command.

     ssttaattuuss [>> _f_i_l_e_n_a_m_e]
	  Print out the currently active ttrraaccee and ssttoopp commands.

     ccoonntt 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 ssttoopp command.

     sstteepp Execute one source line.

     nneexxtt Execute up to the next source line.  The difference



Printed 7/9/88		 April 29, 1985                         2






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



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

     pprriinntt _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''.

     wwhhaattiiss _i_d_e_n_t_i_f_i_e_r
	  Print the declaration of the given identifier.

     wwhhiicchh _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.

     aassssiiggnn _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.

     ccaallll _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.

     hheellpp Print out a synopsis of _p_d_x commands.

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

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

     ssoouurrccee _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 ssttaattuuss command from an earlier debugging session.

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

     lliisstt [_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]]
     lliisstt _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 7/9/88		 April 29, 1985                         3






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



	  procedure or function and _k is small.

     ffiillee [_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.

     eeddiitt [_f_i_l_e_n_a_m_e]
     eeddiitt _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.

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

     sshh _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.

     aalliiaass _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.

     qquuiitt 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.

     ttrraacceeii [_a_d_d_r_e_s_s] [iiff _c_o_n_d]
     ttrraacceeii [_v_a_r_i_a_b_l_e] [aatt _a_d_d_r_e_s_s] [iiff _c_o_n_d]
     ssttooppii [_a_d_d_r_e_s_s] [iiff _c_o_n_d]
     ssttooppii [aatt] [_a_d_d_r_e_s_s] [iiff _c_o_n_d]
	  Turn on tracing or set a stop using a _p_x machine
	  instruction addresses.

     xxii _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.

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



Printed 7/9/88		 April 29, 1985                         4






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



FFIILLEESS
     obj		      Pascal object file
     .pdxinit		      _P_d_x initialization file


SSEEEE AALLSSOO
     pi(1), px(1)
     _A_n _I_n_t_r_o_d_u_c_t_i_o_n _t_o _P_d_x

BBUUGGSS
     _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 ccaallll
     command does a non-local goto.

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

     There should be commands sstteeppii and nneexxttii that correspond to
     sstteepp and nneexxtt 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 7/9/88		 April 29, 1985                         5