home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 February / PCO_0298.ISO / filesbbs / os2 / xrgm005.arj / XRGM005.ZIP / README.DBG < prev    next >
Encoding:
Text File  |  1997-12-15  |  48.7 KB  |  1,696 lines

  1. <  Using OS/2 Warp System Debugging Tools
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.   
  18.  
  19.   
  20.   
  21.  
  22.  
  23.  
  24.   July 18, 1997
  25.  
  26.   
  27.   
  28.   
  29.   
  30.   OS/2 Fix Distribution
  31.   Personal System Products
  32.   Austin, Tx
  33.   
  34.   
  35.   
  36.   
  37.   
  38.   (c) Copyright International Business Machines Corporation, 1997.
  39.   All rights Reserved.
  40.  
  41.   July 18, 1997 - Warp Debug
  42.  
  43.  
  44.  
  45.                         July 18, 1997 - Warp Debug
  46.  
  47.   CONTENTS
  48.  
  49.  
  50.     Overview ......................................................... 1
  51.     Dump Formatter ................................................... 1
  52.     Kernel Debugger .................................................. 2
  53.     System Trace Utilities ........................................... 2
  54.       TRACEGET ....................................................... 3
  55.       TRSPOOL ........................................................ 3
  56.       DTRACE ......................................................... 5
  57.       User Guide ..................................................... 5
  58.       DTRACE functions ............................................... 8
  59.       Format of the Trace Program File .............................. 11
  60.       RPN command syntax ............................................ 12
  61.     File header ..................................................... 13
  62.     Tracepoint header ............................................... 15
  63.     The Trace Program ............................................... 17
  64.     Trace Program Examples .......................................... 27
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.   
  100.                                                             Contents  ii
  101.  
  102.  
  103.                         July 18, 1997 - Warp Debug
  104.  
  105.   OVERVIEW
  106.  
  107.   This README file contains information for the users of the system
  108.   debugging tools:
  109.  
  110.   Ä   Dump Formatter
  111.   Ä   Kernel Debugger
  112.   Ä   System Trace Utilities
  113.  
  114.  
  115.  
  116.   DUMP FORMATTER
  117.  
  118.   With WARP Server SMP and Warp 4.0, each FixPak installs the
  119.   corresponding version of the Dump Formatter and related symbol files
  120.   in
  121.  
  122.   \OS2\SYSTEM\PMDF                        Warp Server SMP
  123.   \OS2\PDPSI\PMDF\WARP4                   Warp 4.0
  124.  
  125.  
  126.   If multiple versions of the Dump Formatter are required then they must
  127.   be installed in directories outside the \OS2 directory tree since the
  128.   fix installation tool will replace all versions of DF_RET.EXE and
  129.   DF_DEB.EXE if finds in the \OS2 directory tree.
  130.  
  131.   Thus, prior to installation of a FixPak the
  132.  
  133.   \OS2\SYSTEM\PMDF                        Warp Server SMP
  134.   \OS2\PDPSI\PMDF\WARP4                   Warp 4.0
  135.  
  136.  
  137.   directory should be copied if it is required for use after the FixPak
  138.   has been installed.
  139.  
  140.   When multiple versions of the Dump Formatter are used the
  141.  
  142.   \OS2\SYSTEM\PMDF\PMDFVERS.LST           Warp Server SMP
  143.   \OS2\PDPSI\PMDF\WARP4\PMDFVERS.LST      Warp 4.0
  144.  
  145.  
  146.   file should be updated to cross reference each system version with its
  147.   corresponding Dump Formatter directory location. The format of
  148.   PMDFVERS.LST entries are:
  149.  
  150.   df-path;build-level;description
  151.  
  152.  
  153.   Dump Formatters and fuller sets of symbols file for various OS/2
  154.   versions may be obtained from:
  155.  
  156.  
  157.   
  158.                                                              Overview  1
  159.  
  160.  
  161.                         July 18, 1997 - Warp Debug
  162.  
  163.   ftp:\\service.boulder.ibm.com\ps\products\os2\fixes\debug
  164.  
  165.  
  166.  
  167.  
  168.   KERNEL DEBUGGER
  169.  
  170.   If the debug kernel is installed when a FixPak is installed then it
  171.   will be replaced by the retail version of new version of the kernel,
  172.   together with any symbol files are that are installed by the FixPak.
  173.   If these files are required after installation of a FixPak then they
  174.   should be copied to a private directory not on the boot drive.
  175.  
  176.   After installation of a FixPak the associated debug (ALLSTRICT and
  177.   HSTRICT) kernel and system symbol files may be obtained from:
  178.  
  179.   ftp:\\service.boulder.ibm.com\ps\products\os2\fixes\debug
  180.  
  181.  
  182.  
  183.  
  184.   SYSTEM TRACE UTILITIES
  185.  
  186.   Each FixPak installs version specific trace formatting (*.TFF) and
  187.   definition files (*.TDF) in the \OS2\SYSTEM\TRACE directory.  If users
  188.   service multiple versions of OS2 they may need to copy the *.TFF files
  189.   to a private directory in order to allow a trace taken from another
  190.   system version to format correctly.  The /T= parameter of TRACEFMT
  191.   will allow the user to specify the TFF path from the command line. The
  192.   TFF path may also be specified by selecting the File pull-down and Set
  193.   TFF path option of TRACEFMT.
  194.  
  195.   In general TFFs are changed for a given release of OS2 except for
  196.   corrective purposes. The TDFs however are dependent on being precisely
  197.   matched to the module version to which they apply. TDFs are used by
  198.   the TRACE command to apply dynamic trace points. If the debug kernel
  199.   is installed then the associated OS2KRNL.TDF must be installed if
  200.   kernel tracing is required.  The TDFs for the HSTRICT and ALLSTRICT
  201.   kernels are packaged with the dump formatter symbols as OS2KRNLB.TDF
  202.   and OS2KRNLD.TDF. These may be obtained from:
  203.  
  204.   ftp:\\service.boulder.ibm.com\ps\products\os2\fixes\debug
  205.  
  206.  
  207.   Note: With OS/2 3.0 Fix Pack 29 and OS/2 4.0 GA the combined
  208.   SYSTEM.TDF and SYSTEM.TFFs were obsoleted.  Individual TFFs and TDFs
  209.   are installed.  However SYSTEM.TFF is sill supported by the TRACEFMT
  210.   command and may be used for earlier versions of OS/2.
  211.  
  212.   Warp 3.0 FixPak 29 and Warp 4.0 GA introduce three new trace
  213.   utilities: TRACEGET, TRSPOOL and DTRACE. These are described below:
  214.  
  215.   
  216.                                                              Overview  2
  217.  
  218.  
  219.                         July 18, 1997 - Warp Debug
  220.  
  221.   TRACEGET
  222.  
  223.   The TACEGET command will extract the System Trace buffer and save it
  224.   in a file. The command syntax:
  225.  
  226.          TRACEGET file
  227.  
  228.  
  229.  
  230.  
  231.   TRSPOOL
  232.  
  233.   TRSPOOL extends the usefulness of the OS/2 system trace facility by
  234.   capturing the single system trace buffer and spooling it a cyclically
  235.   used sequence of disk files.  The captured trace disk files may be
  236.   later formatted using TRACEFMT, by selecting the Open option of the
  237.   File menu.
  238.  
  239.   TRSPOOL operates by polling the system trace buffer until halted by
  240.   pressing Ctrl-C.
  241.  
  242.   The system trace buffer may be captured at regular intervals or by
  243.   "Adaptive polling".
  244.  
  245.   Adaptive polling mode attempts to capture the system trace buffer when
  246.   the system trace buffer is a certain per-centage used.  The polling
  247.   time is adjusted according to the actual usage of the last captured
  248.   buffer.  The adaptive algorithm has a built in hysteresis to avoid the
  249.   affects of short bursts of intensive tracing or moments of inactivity.
  250.   Because there is no system notification of when the trace buffer
  251.   wraps, TRSPOOL may loose trace events under very erratic system
  252.   performance.
  253.  
  254.   TRSPOOL will operate without parameter specification in adaptive
  255.   polling mode. However the following parameters may be specified:
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.   
  274.                                                              Overview  3
  275.  
  276.  
  277.                         July 18, 1997 - Warp Debug
  278.  
  279.    /An Specifies the target per-centage trace buffer usage for adaptive
  280.        spooling.
  281.        Default: 30(%%). This is the default spooling method.
  282.    /Fn Specifies the number of spooled trace buffer files.
  283.        Default: 10.
  284.    /Tn Specifies fixed time trace buffer spooling, in mili-seconds,
  285.        or if specified with /A the initial sleep time.
  286.        Default: Adaptive spooling - /A option + initial sleep time
  287.        2000ms.
  288.        Note: when adaptive spooling is active, the sleep time interval
  289.        is limitated to a range between 50ms and 60000ms. Any time interval
  290.        may be specified with fixed time spooling.
  291.    /Q  Specifies quiet operation - messages are suppressed.
  292.        Default: non-quiet mode.
  293.    /W  Specifies write-through mode. Trace files are pre-allocated
  294.        and opened in write-through mode.
  295.        Default: normal file open mode.
  296.    /P  Specifies trace files should be pre-allocated.
  297.        Default: files are not pre-allocated unless /W is specified.
  298.    /?  Display help.
  299.  
  300.  
  301.   The generated trace buffer files have names: TRACEBUF.nnn, where nnn
  302.   ranges from 000 to the value specified by /Fn.
  303.  
  304.   The /W option is provided for use where tracing precedes a system
  305.   outage and there is no orderly shutdown. This disadvantage of using
  306.   this option is that writing to the TRACEBUG.nnn files is made
  307.   synchronous, consequently the time take to spool the trace buffer will
  308.   be longer.
  309.  
  310.   The /P option pre-allocates and initialises all TRACEBUF.nnn files to
  311.   nulls. This ensures that space is available on hard disk for the
  312.   requisite TRACEBUF.nnn files. In addition there is an improved chance
  313.   that data written to these files will be committed should a system
  314.   outage occur. The /P option is implied by /W.
  315.  
  316.   Note: Neither of the /P or /W options is fail-safe. If a system outage
  317.   occurs after the trace buffer has been read, but before data has been
  318.   committed to disk then it will not be recorded. However, the segment
  319.   allocated by TRSPOOL for the local copy of the trace buffer is
  320.   reported at initialisation. This may also be located from a system
  321.   dump by searching for the eye-catcher "TRSPOOL RAS DATA" in the
  322.   TRSPOOL stack segment. The trace buffer selector follows the
  323.   eye-catcher. The file number of the last file written is also recorded
  324.   as a word following the trace buffer selector.
  325.  
  326.   To use TRSPOOL, the system trace must first be enabled by specifying
  327.  
  328.      TRACEBUF=63
  329.  
  330.  
  331.   
  332.                                                              Overview  4
  333.  
  334.  
  335.                         July 18, 1997 - Warp Debug
  336.  
  337.   in the CONFIG.SYS.
  338.  
  339.   The system trace is activated by using the TRACE command or TRACE=
  340.   statement of CONFIG.SYS.
  341.  
  342.  
  343.   DTRACE
  344.  
  345.   DTRACE exploits the DosDynamicTrace facility at a low-level.  This may
  346.   be used to implement ad-hoc tracing in DLLs, Device Drivers, File
  347.   System Drivers and the OS2 Kernel.  EXE files are also included.
  348.   Dynamic Trace may be used for diagnostic purposes and performance
  349.   monitoring.
  350.  
  351.   Dynamic trace is a facility available within the OS/2 kernel.
  352.   Tracepoints are implemented by modifying dynamically code of modules
  353.   loaded in memory. This is in contrast to Static tracepoints which are
  354.   implemented when applications call the DosSysTrace API.
  355.  
  356.   Dynamic tracepoints are implemented by replacing machine instructions
  357.   at specified points within a module by INT3 instructions.  This is
  358.   done by the DosDynamicTrace API.  When the INT3 instruction executes,
  359.   control is passed to the system TRAP3 exception handler, which in turn
  360.   passes control to Dynamic Trace if the TRAP3 was due to a known
  361.   tracepoint.  Dynamic Trace interprets instructions, which are in
  362.   Reverse Polish Notation, that were passed to it when the trace point
  363.   was defined.  These instructions allow data to be logged in the system
  364.   trace buffer and local variables associated with the tracepoint to be
  365.   manipulated.  After the RPN instruction stream is complete, the
  366.   original instruction is single-stepped then normal execution resumed.
  367.  
  368.   The overhead of dynamic trace is a few milliseconds per tracepoint.
  369.   Normally this is small enough not to make a noticeable difference to
  370.   system performance.
  371.  
  372.  
  373.   USER GUIDE
  374.  
  375.   Command Syntax:
  376.  
  377.          DTRACE APPLY trpgm_file [/h=hmte É /n=name] [/m=major] [/i=id] [/q] [/d]
  378.          DTRACE BUILDTDF trpgm_file [tdf_file] [/m=major] [/n=name] [/i=id] [/q]
  379.   [/d]
  380.          DTRACE REMOVE [trpgm_file É /h=hmte É /n=name] [/q] [/d]
  381.          DTRACE CLEARALL [/q] [/d]
  382.          DTRACE QUERY [/h=hmte É /n=name] [/i=id] [/q] [/d]
  383.          DTRACE GETVARS [/h=hmte É /n=name] [/i=id] [/v=n:m] [/z] [/r] [/q] [/d]
  384.  
  385.  
  386.   Numeric values may be specified in hexadecimal or decimal. Hexadecimal
  387.   values are signified with either the (C -style) 0x prefix, e.g. 0x2f8;
  388.  
  389.   
  390.                                                              Overview  5
  391.  
  392.  
  393.                         July 18, 1997 - Warp Debug
  394.  
  395.   or the (assembler-style) h suffix, e.g. 2f8h
  396.  
  397.   Optional command line parameters (/i, /m,  /h and /n) set defaults
  398.   which override the default settings in the header of the trace program
  399.   file.  Overrides for specific tracepoints take precedence over the
  400.   command line and the header in the trace program file.
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.   
  448.                                                              Overview  6
  449.  
  450.  
  451.                         July 18, 1997 - Warp Debug
  452.  
  453.   hmte: module handle (any module with an MTE). May be specified also in
  454.         the trace program file.
  455.  
  456.   name: module name.
  457.         name may specify a simple name, a name and extension or a
  458.         fully qualified name with path information.
  459.  
  460.         If a fully qualified name is specified then it is used without
  461.         modification to determine the module handle. If this is unccessful
  462.         the no attempt is made to search for the module.
  463.  
  464.         For partially specified names DTRACE attempts to work out the
  465.         module handle according to the following assumptions:
  466.  
  467.            if a simple name without extension is specified then .DLL is
  468.            assumed. If the DLL is not loaded then LIBPATH is used to search
  469.            and load the DLL.
  470.  
  471.            All other module types must specify at the very least
  472.            name and extension. If the module is not already loaded then
  473.            PATH is seached for determine the fully qualified module name
  474.            and hence the module handle.
  475.  
  476.  
  477.         The following types of module may be traced:
  478.  
  479.            Physical Device Drivers
  480.            Virtual Device Drivers
  481.            File System Drivers
  482.            Printer Drivers
  483.            Queue Drivers
  484.            Custom DLLs (DLLs with non-DLL extension names)
  485.            EXE modules
  486.            Custom EXE modules (EXEs with a non_EXE extension or no extension)
  487.            Base device drivers.
  488.            Any of the above in non-PATH or LIBPATH directories.
  489.  
  490.         For BASEDEVs the system records the path name as
  491.         being the root directory of the boot drive regardless of which
  492.         directory the driver was loaded from. DTRACE will attempt to
  493.         derive the module handle of a BASEDEV automatically if only
  494.         name and extension are supplied.
  495.  
  496.         Build BUILDTDF may be used for non-DLL modules however under
  497.         OS/2 3.0+ JR09872 is required for the TRACE command to process
  498.         TDFs for non-DLL modules.
  499.  
  500.   major: The default major code. May also be specified in the trace program
  501.          file. Major codes specified with specific tracepoints in the trace
  502.          program file override any other specification.
  503.  
  504.  
  505.   
  506.                                                              Overview  7
  507.  
  508.  
  509.                         July 18, 1997 - Warp Debug
  510.  
  511.   id: Superset grouping of tracepoints. May include more than one major
  512.       code. Defaults to 0 when defining tracepoints. NB dynamic trace
  513.       generated by TRCUST uses id=0, unless overridden by TDFID=. Id may
  514.       be specified also in the trace program file.
  515.  
  516.       Id is intended for use with the  QUERY and GETVARS functions.
  517.       These functions will assume all non-zero ids are to be processed if
  518.       id is not specified.
  519.  
  520.   n:m Variables n to m. Dynamic Trace variables are referred to by index number
  521.       starting with 0. Number of variables defined is determined by the
  522.       vars= statement of the trace program file.
  523.  
  524.   z:  Zero variables.
  525.  
  526.   r:  Read variables.
  527.  
  528.   q:  Suppress copyright and incidental informational messages.
  529.  
  530.   d:  Debugging switch. This is provided for diagnosing problems with DTRACE.
  531.       It should only be used at the request of Service personnel.
  532.       Note: DTRACE also has associated DTRACE.TDF and TRC0063.TFF files which
  533.       permit inernal tracing of DTRACE itself by means of TRACE ON DTRACE.EXE
  534.  
  535.   trpgm_file: Trace program file. If a simple name is specified then
  536.       an extension of .RPN is assumed.
  537.       See below. for the file description.
  538.  
  539.   tdf_fiie: The generated Trace Definition File name. See below.
  540.  
  541.  
  542.   Options that may also be specified in the trace program file are
  543.   overridden when specified on the command line.
  544.  
  545.  
  546.   DTRACE FUNCTIONS
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.   
  564.                                                              Overview  8
  565.  
  566.  
  567.                         July 18, 1997 - Warp Debug
  568.  
  569.   APPLY:    Insert dynamic tracepoints, specified by the trace program
  570.             file for a module specified by name or hmte. A full
  571.             description of the trace program file is given below.
  572.  
  573.   BUILDTDF: Build a Trace Definition File (TDF) from the definitions
  574.             supplied in the trace program file. The OS/2 TRACE command
  575.             may be used subsequently to apply or removed all or selected
  576.             tracepoints defined in the TDF.
  577.  
  578.             TFD files must be stored in the current directory, DPATH or
  579.             in \OS2\SYSTEM\TRACE.
  580.  
  581.             BUILDTDF permits group and type classifications to be
  582.             specified with each tracepoint. These may be used by the
  583.             OS/2 TRACE command to select subsets of tracepoints to be
  584.             activated. The TRACE command also permits specific minor
  585.             codes, or ranges of minor codes to be specified.
  586.  
  587.             The syntax for the TRACE command using a TDF file is as
  588.             follows:
  589.  
  590.                    TRACE ONÉOFF tdf_file
  591.  
  592.               or   TRACE ON tdf_file(minor spec)
  593.  
  594.               or   TRACE ON tdf_file(group spec)
  595.  
  596.               or   TRACE ON tdf_file(type spec)
  597.  
  598.             where:
  599.  
  600.                    tdf_file is the file name, excluding path and
  601.                    extension of the tdf_file.
  602.  
  603.                    minor spec is a combination of minor code or
  604.                    ranges of minor codes separated by commas.
  605.                    In the following example KERNEL minor codes
  606.                    (decimal) 1, 2 through 10 and 401 are traced.
  607.  
  608.                       TRACE ON KERNEL(1,2-10,401)
  609.  
  610.                    group spec is a combination of groups separated by
  611.                    commas. Each group may further specify one or more
  612.                    types.
  613.                    In the following example KERNEL group FS (with
  614.                    all types) and TK with types PRE and POST is traced.
  615.  
  616.                       TRACE ON KERNEL(FS,TK:PRE+POST)
  617.  
  618.                    type spec is a combination of types separated by
  619.                    commas. In the following example all KERNEL PRE and
  620.  
  621.   
  622.                                                              Overview  9
  623.  
  624.  
  625.                         July 18, 1997 - Warp Debug
  626.  
  627.                    POST type tracepoints are traced.
  628.  
  629.                       TRACE ON KERNEL(PRE,POST)
  630.  
  631.             Notes:
  632.  
  633.             Due to a limitation with the TRACE command, BUILDTDF
  634.             can only be used to create TDFs for DLLs and OS2KRNL unless
  635.             JR09872 is installed.
  636.  
  637.             If the TRACE command fails to find the TDF in the DPATH it
  638.             will look in \OS2\SYSTEM\TRACE\SYSTEM.TDF before looking
  639.             finally for \OS2\SYSTEM\TRACE\tdf_file. The becomes an
  640.             important consideration when one of the pre-existing system
  641.             trace definitions is modified or replaced.
  642.  
  643.             The TRACE command fails to find OS2KRNL.TDF in
  644.             in OS2\SYSTEM\TRACE if executed from a command line where
  645.             the current directory is other than on the boot drive.
  646.             APAR PJ23293 addresses this problem.
  647.  
  648.             See the accompanying TRCTOOLS documentation for further
  649.             information of modifying and replacing system trace
  650.             definitions.
  651.  
  652.   REMOVE:   Remove dynamic tracepoints for a module specified by name or
  653.             handle.
  654.  
  655.   CLEARALL: Remove all dynamic tracepoints for all modules.
  656.  
  657.   QUERY:    Query by id or hmte all traced modules, their ids and number
  658.             of Dynamic Trace variables.
  659.  
  660.             By default all non-zero ids are queried.
  661.  
  662.             Note: Standard system dynamic trace definitions and user
  663.             definitions that are defined using TRCUST are always defined
  664.             with id=0.
  665.  
  666.   GETVARS:  Retrieve and/or set to zero the Dynamic Trace variables for
  667.             a given id or module.
  668.  
  669.             By default all variables of all non-zero ids are retrieved.
  670.  
  671.             Variables are displayed as a list in hexadecimal and decimal
  672.             formats.
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.   
  680.                                                             Overview  10
  681.  
  682.  
  683.                         July 18, 1997 - Warp Debug
  684.  
  685.   FORMAT OF THE TRACE PROGRAM FILE
  686.  
  687.   This file specifies one or more tracepoints for a module.  Each
  688.   tracepoint may have an associated program that species to DynamicTrace
  689.   what variables to manipulate and what data to log in the system trace
  690.   buffer when the tracepoint fires.
  691.  
  692.   Comments may appear after the instructions or on whole lines. They are
  693.   prefixed with a semi-colon.
  694.  
  695.   Blanks are ignored by DTRACE.
  696.  
  697.   The trace program consists of a header followed by one or more
  698.   tracepoint definitions. Each tracepoint definition has a header
  699.   followed by an optional program specified as a sequence of Reverse
  700.   Polish Notation instructions.  The RPN commands use a circular stack
  701.   of 16 double-word elements as a work space.  The top element of the
  702.   stack is the only immediately accessible element.  As each element is
  703.   accessed the top of stack (TOS) pointer is moved to point to the
  704.   preceding stack element - this is referred to as a POP operation even
  705.   though the popped stack element is not actually removed from the
  706.   stack.  Thus an RPN command that takes two stack parameters pops the
  707.   two topmost elements from the stack.  Whenever data on the stack is
  708.   referenced it is done so in integral numbers of elements.  Thus
  709.   pushing or popping a word will move the stack pointer as if a
  710.   double-word had been pushed or popped. Word and byte length data is
  711.   always padded to a double-word when pushed on to the stack.
  712.  
  713.   The trace program may be used for three purposes (which may be
  714.   combined):
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.   
  738.                                                             Overview  11
  739.  
  740.  
  741.                         July 18, 1997 - Warp Debug
  742.  
  743.   1) To cause one or more items of data to be logged in the system
  744.      trace buffer.
  745.  
  746.   2) To update local variables which are associated with a particular
  747.      module being traced.
  748.   3) To detect a specific condition (value of a register, value in
  749.      memory or code path) and force a System Dump when that condition
  750.      occurs.
  751.  
  752.      NB: this function is not available in all releases of OS/2.
  753.  
  754.  
  755.   The entire set of trace definitions and local variables for a
  756.   particular module is referred to as a Dynamic Trace Object (DTO).
  757.  
  758.  
  759.   One DTO may exist per module. DosDynamicTrace will not merge an
  760.   existing DTO with additional definitions for the same module.
  761.  
  762.  
  763.   DTOs for several modules may be grouped under the same id - see
  764.   the /i parameter above and the id= parameter below.
  765.  
  766.  
  767.   RPN COMMAND SYNTAX
  768.  
  769.   RPN command syntax rules are as follows:
  770.  
  771.   [label:] operator [operand1 [,operand2 [, ..... ]]] [; comment]
  772.   [;comment]
  773.  
  774.   Where:
  775.  
  776.   label
  777.         is an optional string of 1 - 255 characters, excluding ':',
  778.         initiated with a non-numeric character and delimited by a ':'.
  779.         A label must always precede a command, but the command my be
  780.         coded on the following line. Labels are for use by the jump
  781.         instructions as an alternative to coding an explicit numeric
  782.         value. Backward jumping is not permitted.
  783.  
  784.   operator
  785.         is one of the valid RPN commands listed below.
  786.  
  787.   operand1,...
  788.         are operands as defined by each RPN command.
  789.  
  790.  
  791.   A comment is initiated by a ';' and may follow on the same line as a
  792.   command or on a new line.
  793.  
  794.  
  795.   
  796.                                                             Overview  12
  797.  
  798.  
  799.                         July 18, 1997 - Warp Debug
  800.  
  801.   RPN commands,labels and operators are case insensitive.
  802.  
  803.   Imbedded blanks are ignored.
  804.  
  805.   Data logged by DTRACE may be formatted using TRACEFMT. The format will
  806.   be in hexadecimal bytes unless a custom trace format file has been
  807.   generated using the TRCUST utility. When using TRCUST, specify the TP
  808.   parameter as @STATIC. The prefixes %P and %R may be used. See the OS/2
  809.   Debugging Handbook (SBOF-8617).
  810.  
  811.   Refer to the OS/2 Debugging Handbook, Volume 1 and 3 for further
  812.   information on the system trace utility.
  813.  
  814.  
  815.   FILE HEADER
  816.  
  817.   Zero or more of the following may be specified, in any order:
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.   
  854.                                                             Overview  13
  855.  
  856.  
  857.                         July 18, 1997 - Warp Debug
  858.  
  859.   vars=     Number of Dynamic Trace variables to be defined
  860.             (initialised to zero).
  861.   major=    Major code
  862.   hmte=     Module handle
  863.   id=       DTO grouping id - not to be confused with typedef or
  864.             groupdef ids. This is a gouping of Dynamic Trace Objects.
  865.             The default DTO id is 0. Id is used with GETVARS and QUERY
  866.             functions.
  867.   logmax=   Maximum data to be logged in the trace buffer (default 512
  868.             bytes).
  869.   name=     Module name. See name specification above.
  870.   typedef=  Defines a type keyword. This is used only by the BUILDTDF
  871.             function. The definition is specified as:
  872.  
  873.                  typedef=keyword,id.
  874.  
  875.              Keyword is a string, which is used by type statements, see
  876.              below.
  877.  
  878.              id is a value equal to a power of two in the range 2**1 to
  879.              2**31.
  880.  
  881.              Multple typedef statements my be specified.
  882.  
  883.   groupdef= Defines a group keyword. This is used only by the BUILDTDF
  884.             function. The definition is specified as:
  885.  
  886.                  groupdef=keyword,id.
  887.  
  888.              Keyword is a string, which is used by group statements, see
  889.              below.
  890.  
  891.              id is a value in the rande 0x to 0xffffffff.
  892.  
  893.              Multple groupdef statements my be specified.
  894.  
  895.  
  896.   Major code and hmte are required but may be specified or overridden by
  897.   the command line parameters.
  898.  
  899.   If name and hmte are specified then the first parameter encountered
  900.   takes precedence.
  901.  
  902.   id defaults to zero.
  903.  
  904.   vars defaults to zero.
  905.  
  906.   logmax defaults to 512.
  907.  
  908.   The BUILDTDF function requires all definitions to be completely
  909.   specified within the trace program file. Furthermore name must be
  910.  
  911.   
  912.                                                             Overview  14
  913.  
  914.  
  915.                         July 18, 1997 - Warp Debug
  916.  
  917.   specified rather than a module's hmte.
  918.  
  919.  
  920.   TRACEPOINT HEADER
  921.  
  922.   The following must be specified, in any order, with the exception that
  923.   minor= must appear first.
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.   
  970.                                                             Overview  15
  971.  
  972.  
  973.                         July 18, 1997 - Warp Debug
  974.  
  975.   minor=    Tracepoint minor code
  976.  
  977.   major=    Tracepoint major code - this may be respecified for
  978.             each tracepoint and overrides the major code specified
  979.             in the file header. This applies to which the current
  980.             tracepoint.
  981.  
  982.   opcode=   Byte of opcode in module where the tracepoint will be
  983.             inserted.
  984.  
  985.   object=   Relative object of module where trace point will be
  986.             applied. Objects are numbered from 1.
  987.  
  988.   offset=   Offset within object where tracepoint will be applied.
  989.  
  990.   major=    The major code override for a specific tracepoint. The
  991.             default major code must be specified in the header to the
  992.             trace program file.
  993.  
  994.   type=     Type is an optional parameter that is used only by the
  995.             BUILDTDF function. Its purpose is to associate with each
  996.             tracepoint one or more types. These are used by the
  997.             OS/2 TRACE command as a means of selecting a subset of the
  998.             tracepoints defined in the generated TDF. The operand to the
  999.             type= statement is be specified as a sequence of one or more
  1000.             keyword names defined by typedef statements, separated
  1001.             '+' signs as follows:
  1002.  
  1003.                 type=[keyword1[+keyword2 ...]]
  1004.  
  1005.             A typical use of the trace type is to associate a particular
  1006.             tracepoint with a particular characteristic. For example,
  1007.             tracepoints in DOSCALL1 and KERNEL use type=PRE for API
  1008.             pre-invocation tracepoints and type=POST for
  1009.             API post-invocation tracepoints.
  1010.  
  1011.             Only one type statement is permissible per tracepoint.
  1012.  
  1013.   group=    Group is an optional parameter that is used only by the
  1014.             BUILDTDF function. Its purpose is to associate related
  1015.             subsets of the set of tracepoints defined in the generated
  1016.             TDF. These are used by the OS/2 TRACE command as a means of
  1017.             selecting a subset of the tracepoints defined in the
  1018.             generated TDF. The operand to the group= statement is
  1019.             specified as a single keyword name that has been defined by
  1020.             the groupdef statements.
  1021.  
  1022.             A typical use of the trace group is to associate all
  1023.             tracepoints that relate to a particular component of the
  1024.             system. For example, the group FS is used to associate all
  1025.             tracepionts in DOSCALL1 and KERNEL that relate to the
  1026.  
  1027.   
  1028.                                                             Overview  16
  1029.  
  1030.  
  1031.                         July 18, 1997 - Warp Debug
  1032.  
  1033.             file-system.
  1034.  
  1035.             Group is intended to be an exclusive classification of
  1036.             tracepoints compared with Type. Only one group may be
  1037.             associated with a particular tracepoint, whereas a
  1038.             tracepoint may have several type.
  1039.  
  1040.             Only one group statement is permissible per tracepoint.
  1041.  
  1042.  
  1043.  
  1044.  
  1045.   THE TRACE PROGRAM
  1046.  
  1047.   Trace program may specify any meaningful combination of the following
  1048.   RPN instructions. (TOS = Top of Stack).
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.   
  1086.                                                             Overview  17
  1087.  
  1088.  
  1089.                         July 18, 1997 - Warp Debug
  1090.  
  1091.   Leng  Mnem  Operand(s)  Description
  1092.   -th   -onic
  1093.   Bytes
  1094.   ---------------------------------------------------------------------
  1095.   1     Abort             Abort - Log No Information
  1096.   1     Add               Add top 2 DWORD stack elements
  1097.   1     Cnvrt DXS         Convert Dword to Segmented
  1098.   1     Cnvrt FXS         Convert Flat to Segmented
  1099.   1     Cnvrt SXD         Convert Segmented to Dword
  1100.   1     Cnvrt SXF         Convert Segmented to Flat
  1101.   3     Inc   V,word      Increment Immediate Variable
  1102.   1     Inc   VIi         Increment indexed Variable
  1103.   3     Jmp   N,word      Jump forward N bytes or to a label
  1104.   3     Jmp   NN,word     Jump forward N bytes or to a label if TOS < 0
  1105.   3     Jmp   PN,word     Jump forward N bytes or to a label if TOS > 0
  1106.   3     Jmp   ZN,word     Jump forward N bytes or to a label if TOS = 0
  1107.   1     Log   ARF         Log ASCIIZ at Flat Range
  1108.   1     Log   ARS         Log ASCIIZ at Segmented Range
  1109.   2     Log   DN,byte     Log N DWORDs
  1110.   1     Log   MRF         Log Memory at Flat Range
  1111.   1     Log   MRS         Log Memory at Segmented Range
  1112.   2     Log   WN,byte     Log N WORDs
  1113.   3     Move  V,word      Move top of stack to Immediate Var.
  1114.   1     Move  VIi         Move top of stack to indexed Var.
  1115.   1     Mul               Multiply top 2 stack elements
  1116.   3     Or    V,word      OR immed. indexed variable with TOS
  1117.   2     Pop   N,byte      Rotate stack down (pop) N times
  1118.   1     Push  CS          Push contents of (CS)
  1119.   5     Push  D,dword     Push DWORD Immediate
  1120.   1     Push  DS          Push contents of (DS)
  1121.   1     Push  EAX         Push contents of (EAX)
  1122.   1     Push  EBP         Push contents of (EBP)
  1123.   1     Push  EBX         Push contents of (EBX)
  1124.   1     Push  ECX         Push contents of (ECX)
  1125.   1     Push  EDI         Push contents of (EDI)
  1126.   1     Push  EDX         Push contents of (EDX)
  1127.   1     Push  EFlags      Push contents of (EFlags)
  1128.   1     Push  EIP         Push contents of (EIP)
  1129.   1     Push  ES          Push contents of (ES)
  1130.   1     Push  ESI         Push contents of (ESI)
  1131.   1     Push  ESP         Push contents of (ESP)
  1132.   1     Push  FIF         Push Flat Indirect Flat
  1133.   1     Push  FS          Push contents of (FS)
  1134.   1     Push  GS          Push contents of (GS)
  1135.   5     Push  OXF,dword   Push (DWORD Object to Flat Address)
  1136.   2     Push  OXS,byte    Push (Object to Selector)
  1137.   1     Push  SIS         Push Segmented Indirect Segmented
  1138.   1     Push  SS          Push contents of (SS)
  1139.   3     Push  V,word      Push Immediate Variable
  1140.   1     Push  VIi         Push indexed Variable
  1141.   3     Push  W,word      Push WORD Immediate
  1142.  
  1143.   
  1144.                                                             Overview  18
  1145.  
  1146.  
  1147.                         July 18, 1997 - Warp Debug
  1148.  
  1149.   1     Push  WIS         Push WORD Indirect Segmented
  1150.   1     Remove            Remove the current tracepoint
  1151.   1     Sub               Subtract top 2 stack elements
  1152.   1     SysDump           Force a system Dump (*)
  1153.   1     And               AND top 2 stack elements (*)
  1154.   1     Or                OR top 2 stack elements (*)
  1155.   1     Xor               XOR top 2 stack elements (*)
  1156.   1     Neg               1's complement TOS (*)
  1157.   1     Exit              Log data and exit tracepoint (*)
  1158.   3     SetMin W,word     Override the tracepoint minor code with 'word' (**)
  1159.   1     SetMin            Override the tracepoint minor code from TOS    (**)
  1160.   3     SetMaj W,word     Override the tracepoint major code with 'word' (**)
  1161.   1     SetMaj            Override the tracepoint major code from TOS    (**)
  1162.   1     Xchg              Swap top two elements on the stack.            (**)
  1163.  
  1164.  
  1165.   * Each of the commands flagged with (*) require APAR PJ22196 applying
  1166.   to the OS2KRNL (available with Warp 3.0 FixPak 29 and Warp 4.0 GA).
  1167.  
  1168.   ** Each of the commands flagged with (**) will be supported the GA
  1169.   version of OS/2 Warp 4.0 and Warp 3.0 FixPak 29.
  1170.  
  1171.   Each of these commands acts as follows:
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.   
  1202.                                                             Overview  19
  1203.  
  1204.  
  1205.                         July 18, 1997 - Warp Debug
  1206.  
  1207.   PUSH: Push a value on to the RPN stack
  1208.  
  1209.      In Push SS and Push ESP the value of SS and ESP is dependent on whether the
  1210.      tracepoint occurred at ring 0 or not.
  1211.  
  1212.      In Push EIP, the EIP on the stack is one too large, due to the
  1213.      INT3.
  1214.  
  1215.      Push W takes a word operand, zero extends it, and pushes
  1216.      it on to the RPN stack.
  1217.  
  1218.      Push OXS converts its byte operand into a selector,
  1219.      zero extends that value, and pushes it on to the stack.
  1220.      The byte operand is on object number of the module which
  1221.      is currenlty being traced.
  1222.      Because MTEs may eventually become nonresident, the selectors
  1223.      (up to 256) are stored in an array by DynamicTrace  when the tracepoints
  1224.      were inserted.  The word operand indexes this array to get the sel.
  1225.  
  1226.      Push WIS pops an offset, then a selector, from the RPN stack,
  1227.      fetches the user word at that 16:16 address, zero extends it,
  1228.      and pushes that on to the RPN stack.
  1229.      If the address is invalid or not present, a GP fault or Page
  1230.      fault record will be logged in the buffer, and the interpreter
  1231.      will exit.
  1232.  
  1233.      Push SIS pops an offset, then a selector, from the RPN stack,
  1234.      fetches the user dword at that 16:16 address and pushes that on to
  1235.      the RPN stack in the segmented address format.* That is,
  1236.      the high word (selector) is zero extended and pushed, and then
  1237.      the low word (offset) is zero extended and pushed.
  1238.      If the address is invalid or not present, a GP fault or Page
  1239.      fault record will be logged in the buffer, and the interpreter
  1240.      will exit.
  1241.  
  1242.      Push OXF converts its dword operand into a flat address,
  1243.      and pushes that on to the stack. See description of PUSH OXS for
  1244.      more details.
  1245.  
  1246.      Push FIF pops a Dword from the RPN stack, and then
  1247.      pushes the dword at that flat address on to the stack.
  1248.  
  1249.      Push V takes a word operand. Push V uses that to index
  1250.      to the Dynamic Trace variable in the current DTO, and pushes the value
  1251.      it finds there.
  1252.  
  1253.      Push VIi fetches an index of a Dynamic Trace variable from
  1254.      the top of the stack, (without doing a pop), and then
  1255.      pushes the value of that variable on to the stack.
  1256.  
  1257.   LOG: Log data in the system trace buffer.
  1258.  
  1259.   
  1260.                                                             Overview  20
  1261.  
  1262.  
  1263.                         July 18, 1997 - Warp Debug
  1264.  
  1265.  
  1266.      Log WN takes a byte operand, and repeats the following operation
  1267.      that many times:
  1268.         Pop the value from the top of the RPN stack
  1269.         Log the low word of that value, ignoring the high word.
  1270.      If the log overflows, the interpreter will exit without continuing,
  1271.      but will record as much as it can.
  1272.  
  1273.      Log MRS pops the following from the RPN stack:
  1274.        Offset
  1275.        Selector
  1276.        Length
  1277.  
  1278.      Log MRS then zero extends all these values, and attempts to
  1279.      move Length number of bytes from the given 16:16 address into
  1280.      the log buffer.
  1281.  
  1282.      The logged memory is prefixed by 3 bytes :
  1283.        Token byte of 0,
  1284.        Length word (length of logged information, in bytes)
  1285.  
  1286.      If an address is invalid or not present, a GP fault or Page
  1287.      fault record will be logged in the buffer, and the interpreter
  1288.      will exit.
  1289.  
  1290.      If the log overflows, the interpreter will exit without continuing,
  1291.      and without logging the memory.
  1292.  
  1293.      Log ARS pops the following from the RPN stack:
  1294.        Offset
  1295.        Selector
  1296.        Length
  1297.  
  1298.      Log ARS then zero extends all these values, and attempts to
  1299.      move Length number of bytes from the given 16:16 address into
  1300.      the log buffer.  The data transfer will be discontinued if a
  1301.      null byte is fetched.  The null byte will not be logged.
  1302.  
  1303.      The logged string is prefixed by 3 bytes :
  1304.        Token byte of 1,
  1305.        Length word (length of logged information, in bytes)
  1306.  
  1307.      If an address is invalid or not present, a GP fault or Page
  1308.      fault record will be logged in the buffer, and the interpreter
  1309.      will exit.
  1310.  
  1311.      If the log overflows, the interpreter will exit without continuing,
  1312.      and without logging the string.
  1313.  
  1314.      Log DN takes a byte operand, and repeats the following operation
  1315.      that many times:
  1316.  
  1317.   
  1318.                                                             Overview  21
  1319.  
  1320.  
  1321.                         July 18, 1997 - Warp Debug
  1322.  
  1323.         Pop the value from the top of the RPN stack
  1324.         Log the value (as a DWORD)
  1325.  
  1326.      If the log overflows, the interpreter will exit without continuing,
  1327.      but will record as much as it can.
  1328.  
  1329.      Log MRF pops the following from the RPN stack:
  1330.         Flat Address
  1331.         Length
  1332.  
  1333.      Log MRF then zero extends the length, and attempts to move
  1334.      Length number of bytes from the given flat address into
  1335.      the log buffer.
  1336.  
  1337.      The logged memory is prefixed by 3 bytes :
  1338.         Token byte of 0,
  1339.         Length word (length of logged information, in bytes)
  1340.  
  1341.      If an address is not present, a Page fault record will be
  1342.      logged in the buffer, and the interpreter will exit.
  1343.  
  1344.      If the log overflows, the interpreter will exit without continuing,
  1345.      and without logging the memory.
  1346.  
  1347.  
  1348.      Log ARF pops the following from the RPN stack:
  1349.         Flat Address
  1350.         Length
  1351.  
  1352.      Log ARF then zero extends the length, and attempts to move
  1353.      Length number of bytes from the given flat address into
  1354.      the log buffer.  The data transfer will be discontinued if a
  1355.      null byte is fetched.  The null byte will not be logged.
  1356.  
  1357.      The logged string is prefixed by 3 bytes :
  1358.         Token byte of 1,
  1359.         Length word (length of logged information, in bytes)
  1360.  
  1361.      If an address is not present, a Page fault record will be
  1362.      logged in the buffer, and the interpreter will exit.
  1363.  
  1364.      If the log overflows, the interpreter will exit without continuing,
  1365.      and without logging the string.
  1366.  
  1367.  
  1368.      When memory references are invalid the token byte is set to one of
  1369.      the following to indicate the type of error encountered:
  1370.  
  1371.         -1  Invalid Selector
  1372.         -2  Selector not Present
  1373.         -3  Page not Present
  1374.  
  1375.   
  1376.                                                             Overview  22
  1377.  
  1378.  
  1379.                         July 18, 1997 - Warp Debug
  1380.  
  1381.  
  1382.      The byte count is set to 4 and the data logged is the fault
  1383.      address.
  1384.  
  1385.  
  1386.   ADD/SUB/MUL/AND/OR/XOR: Add/Subtact/Multiply the top two stack
  1387.      elements
  1388.  
  1389.      Add pops two DWORDs from the RPN stack, and pushes their sum.
  1390.  
  1391.      Sub pops two DWORDs from the RPN stack, and pushes their
  1392.      difference.   The first value popped is subtracted from the second.
  1393.  
  1394.      Mul pops two DWORDs from the RPN stack, and pushes their
  1395.      product.
  1396.  
  1397.      And pops two DWORDs from the RPN stack, and pushes their
  1398.      bit-wise AND.
  1399.  
  1400.      Or pops two DWORDs from the RPN stack, and pushes their
  1401.      bit-wise Or.
  1402.  
  1403.      Xor pops two DWORDs from the RPN stack, and pushes their
  1404.      bit-wise Xor.
  1405.  
  1406.   NEG: 1's complement top of stack.
  1407.  
  1408.      Neg 1's complements the TOS. No data is pushed or popped.
  1409.  
  1410.   CNVRT: Convert an address
  1411.  
  1412.      Cnvrt FXS pops a dword from the RPN stack, uses CRMA
  1413.      to translate that flat pointer to a 16:16 segmented pointer.
  1414.      It then pushes the selector (zero extended) and then the
  1415.      offset (zero extended) on to the stack.
  1416.  
  1417.      If the flat address does not lie within the compatibility
  1418.      region, the interpreter will exit immediately.
  1419.  
  1420.  
  1421.      Cnvrt SXF pops a selector, then an offset from the RPN stack,
  1422.      uses CRMA to translate that 16:16 pointer to a flat address,
  1423.      and pushes that flat address on to the stack.
  1424.  
  1425.      If the segmented address does not lie within the comparability
  1426.      region (GDT selector), the interpreter will exit immediately.
  1427.  
  1428.      Cnvrt DXS pops a DWORD, then pushes the high word (zero
  1429.      extended) and then the low word (zero extended).  No CRMA is
  1430.      applied.
  1431.  
  1432.  
  1433.   
  1434.                                                             Overview  23
  1435.  
  1436.  
  1437.                         July 18, 1997 - Warp Debug
  1438.  
  1439.      Cnvrt SXD pops a low word, then a high word, then
  1440.      concatenates them into a DWORD, and pushes the result.
  1441.  
  1442.  
  1443.   POP: Pop a value from the RPN stack.
  1444.  
  1445.        Pop N takes a byte operand, and pops that many operands
  1446.        from the stack.  As the values are not actually removed from
  1447.        the 16-element circular stack, Pop N effectively rotates
  1448.        the stack down.
  1449.  
  1450.  
  1451.   MOVE: Move a value to a variable.
  1452.  
  1453.      Move V takes a word operand. Move V then moves
  1454.      the value on the top of the stack to the Dynamic Trace variable
  1455.      in the current DTO at that index.  The top of stack pointer
  1456.      is not changed.
  1457.  
  1458.      Move VIi pops a variable index off the top of the stack,
  1459.      and then pops a value off the top of the stack.  The value is moved
  1460.      into the Dynamic Trace variable in the current DTO at that index.
  1461.      The variable and the index are then pushed back on to the stack,
  1462.      so that there is no net change on the stack at all.
  1463.  
  1464.      If the index is too large, the interpreter will exit with an error.
  1465.  
  1466.   INC: Increment a variable.
  1467.  
  1468.      Inc V takes a word operand, and increments the value in the
  1469.      Dynamic Trace variable in the current DTO at that index.
  1470.  
  1471.      Inc VIi fetches an index of a Dynamic Trace variable from
  1472.      the top of the stack, (without doing a pop), and then
  1473.      increments the value of that variable.
  1474.  
  1475.      If the index is too large, the interpreter will exit with an error.
  1476.  
  1477.  
  1478.   JMP: Jump forward in the RPN program.
  1479.  
  1480.      Jmp takes a word or label as operand.  Jmp causes an
  1481.      unconditional jump forward in the instruction stream by
  1482.      that number of bytes, relative to the first byte of the next
  1483.      instruction.
  1484.  
  1485.      Therefore, Jmp by 0 bytes is a NOP (i.e jmp n,0)
  1486.  
  1487.  
  1488.      Jmp ZN takes a word or label as operand.  Jmp ZN causes an
  1489.      unconditional jump forward in the instruction stream by
  1490.  
  1491.   
  1492.                                                             Overview  24
  1493.  
  1494.  
  1495.                         July 18, 1997 - Warp Debug
  1496.  
  1497.      that number of bytes, relative to the end of the instruction,
  1498.      but only if the value on the top of the stack is zero.
  1499.  
  1500.      Jmp NN takes a word or label operand.  JmpNN causes an
  1501.      unconditional jump forward in the instruction stream by
  1502.      that number of bytes, relative to the end of the instruction,
  1503.      but only if the value on the top of the stack is negative.
  1504.  
  1505.      Jmp PN takes a word or label operand.  Jmp PN causes an
  1506.      unconditional jump forward in the instruction stream by
  1507.      that number of bytes, relative to the end of the instruction,
  1508.      but only if the value on the top of the stack is positive.
  1509.  
  1510.      To prevent loops, no backward jumps are permitted.  Also, it is
  1511.      illegal to jump into the code stream for another tracepoint.
  1512.  
  1513.      If labels are specified, DTRACE calculates the relative forward
  1514.      offset.
  1515.  
  1516.   REMOVE: Remove and Abort the current tracepoint.
  1517.  
  1518.   ABORT:  Abort the tracepoint.
  1519.  
  1520.      Abort aborts the tracepoint entirely.  The interpreter
  1521.      exits, but does not log any information.  The data logged
  1522.      by this tracepoint is lost.
  1523.  
  1524.      However, alterations to the variables remain.
  1525.  
  1526.      By using Abort in combination with the Jmp
  1527.      instructions, unnecessary tracepoints can be filtered
  1528.      at run time, without crowding or overflowing the log buffer.
  1529.  
  1530.   EXIT:  Exit the tracepoint.
  1531.  
  1532.      Exit terminates the tracepoint.  The interpreter
  1533.      exits, and logs any information requested so far. The tracepoint
  1534.      remains in tact.
  1535.  
  1536.      By using Exit in combination with the Jmp
  1537.      instructions, specific conditions can be detected before logging
  1538.      additional data.
  1539.  
  1540.      If Exit is not available (systems without PJ22196) then the
  1541.      equivalent may be achieved by coding:
  1542.  
  1543.            jmp n,exit
  1544.            .
  1545.            .
  1546.            .
  1547.            .
  1548.  
  1549.   
  1550.                                                             Overview  25
  1551.  
  1552.  
  1553.                         July 18, 1997 - Warp Debug
  1554.  
  1555.      exit: jmp n,0 ;nop
  1556.  
  1557.  
  1558.   ORV: OR a Dynamic Trace variable with TOS.
  1559.  
  1560.   SYSDUMP: Force a System Dump.
  1561.  
  1562.      SysDump transfers control to the stand alone dump process. No
  1563.      data is logged. No system shutdown is performed and normal
  1564.      system execution is terminated immediately.
  1565.  
  1566.      Use this command with the Jmp instructions to detect illusive error
  1567.      conditions that require dump analysis at the point of error.
  1568.  
  1569.  
  1570.   SETMAJ: Override the tracepoint major code
  1571.  
  1572.      SetMaj takes the word value from the TSO to override the tracepoint
  1573.      major code. The override remains in effect until the current RPN
  1574.      program exits. Since data is not logged to the system trace buffer
  1575.      until the RPN program exits, the major code may be overridden at any
  1576.      point and remain effective for the whole trace entry.
  1577.  
  1578.      SetMaj may be specified with the W,word operand form. In this case
  1579.      'word' forms the major code override.
  1580.      Note: The system trace facility currently admits only major codes
  1581.      from 0 - 255. Any specification of a major code greater than 255
  1582.      will be treated as if the high-order byte value is zero.
  1583.  
  1584.      This is provided to allow trace formatting templates to be
  1585.      selected dynamically according to the data logged.
  1586.  
  1587.   SETMIN: Override the tracepoint minor code
  1588.  
  1589.      SetMin takes the word value from the TSO to override the tracepoint
  1590.      minor code. The override remains in effect until the current RPN
  1591.      program exits. Since data is not logged to the system trace buffer
  1592.      until the RPN program exits, the minor code may be overridden at
  1593.      any point and remain effective for the whole trace entry.
  1594.  
  1595.      SetMin may be specified with the W,word operand form. In this case
  1596.      'word' forms the minor code override.
  1597.  
  1598.      The system trace facility admit minor codes in the range from
  1599.      0x0000 to 0xffff.
  1600.  
  1601.      This is provided to allow trace formatting templates to be
  1602.      selected dynamically according to the data logged.
  1603.  
  1604.  
  1605.   XCHG: Exchange the top two entries on the RPN Stack.
  1606.  
  1607.   
  1608.                                                             Overview  26
  1609.  
  1610.  
  1611.                         July 18, 1997 - Warp Debug
  1612.  
  1613.  
  1614.      Xchg pops the top two stack elements then pushes them back on to
  1615.      the stack in the reverse order.
  1616.  
  1617.  
  1618.  
  1619.  
  1620.   TRACE PROGRAM EXAMPLES
  1621.  
  1622.   The following examples illustrate common usages of the RPN commands.
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.   
  1666.                                                             Overview  27
  1667.  
  1668.  
  1669.                         July 18, 1997 - Warp Debug
  1670.  
  1671.   1) Log AX and BX registers:
  1672.  
  1673.          Push EBX
  1674.          Push EAX
  1675.          Log  WN,2 ;lower 16 bits of each DWORD
  1676.  
  1677.   2) Log EIP, EBP and EAX:
  1678.  
  1679.          Push EAX
  1680.          Push EBP
  1681.          Push EIP
  1682.          Log  DN,3  ;3 DWORDs from the stack
  1683.  
  1684.   3) Log value at EBP+ESI:
  1685.  
  1686.          Push W,4  ; push immediate value 4 - length to log
  1687.          Push EBP
  1688.          Push ESI
  1689.          Add       ; add top two DWORDs - puts EBP+ESI on stack
  1690.          Log  MRF  ; log memory at flat address range
  1691.  
  1692.   4) Log value at SS:SP using 16-bit segmented addressing:
  1693.  
  1694.          Push W,9  ; push immediate  value 9 - length to log
  1695.          Push SS
  1696.          Push ESP
  1697.          Log  MRS  ; log memory at segmented address range
  1698.  
  1699.   5) Log 16 bytes of data pointed to by the flat address at SS:SP+8
  1700.  
  1701.          Push W,16 ; push immediate value 16 - length to log
  1702.          Push SS
  1703.          Push ESP
  1704.          Push 8    ; offset 8
  1705.          Add       ; 8 added to ESP value on stack
  1706.          Push SIS  ; pop ESP then SS and pop Dword at that address
  1707.                    ; as two Words extended to Dwords (as if it was a sel:offset).
  1708.                    ; stack now contains the length and split address of data to log
  1709.          Cnvrt SXD ; Concatenate the two words to form a flat address
  1710.          Log  MRF  ; log the data.
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.   
  1724.                                                             Overview  28
  1725.