       1mcmdtrace  4m22mlevel24m  |  1mon  22m?1mnoeval22m? ?1mnotruncate22m? ?4mprocs24m? ?4mfileid24m? ?1mcommand0m
       4mcmd24m?

              Print  a  trace  statement for all commands executed at depth of
              4mlevel24m or below (1 is the top level).  If 1mon  22mis  specified,  all
              commands  at  any  level  are traced.  The following options are
              available:

              1mnoeval 22mCauses arguments to be printed unevaluated.  If 1mnoeval 22mis
                     specified,  the  arguments are printed before evaluation.
                     Otherwise, they are printed afterwards.

                     If the command line is longer than 60 characters,  it  is
                     truncated  to  60  and  a "..." is postpended to indicate
                     that there was more output than  was  displayed.   If  an
                     evaluated  argument contains a space, the entire argument
                     will be enclosed inside of braces  (`{}')  to  allow  the
                     reader  to  visually  separate  the  arguments  from each
                     other.

              1mnotruncate0m
                     Disables the truncation of commands and  evaluated  argu-
                     ments.

              1mprocs  22mEnables  the  tracing  of procedure calls only.  Commands
                     that aren't procedure calls (i.e. calls to commands  that
                     are written in C, C++ or some object-compatible language)
                     are not traced if the 1mprocs 22moption  is  specified.   This
                     option  is  particularly  useful for greatly reducing the
                     output of 1mcmdtrace 22mwhile debugging.

              1mfileid 22mThis is a file id as returned by the  1mopen  22mcommand.   If
                     specified,  then  the trace output will be written to the
                     file rather than stdout.  A stdio buffer  flush  is  done
                     after every line is written so that the trace may be mon-
                     itored  externally  or  provide  useful  information  for
                     debugging problems that cause core dumps.

              1mcommand 4m22mcmd0m

                     Call  the  specified  command 4mcmd24m on when each command is
                     executed instead of tracing to a file.  See the  descrip-
                     tion  of  the functionally below.  This option may not be
                     specified with a 1mfileid22m.

              The most common use of this command is to enable  tracing  to  a
              file  during  the  development.  If a failure occurs, a trace is
              then available when needed.  Command tracing will slow down  the
              execution  of  code,  so  it  should  be  removed  when  code is
              debugged.  The following command will enable tracing to  a  file
              for the remainder of the program:

                   cmdtrace on [open cmd.log w]

              The  1mcommand  22moption causes a user specified trace command to be
              called for each command executed.  The  command  will  have  the
              following arguments appended to it before evaluation:

              4mcommand0m
                     A  string  containing the text of the command, before any
                     argument substitution.

              4margv24m   A list of the final argument  information  that  will  be
                     passed  to the command after command, variable, and back-
                     slash substitution.

              4mevalLevel0m
                     The 1mTcl_Eval 22mcall level.

              4mprocLevel0m
                     The procedure call level.

              The command should be constructed in such a manner that it  will
              work  if  additional  arguments  are added in the future.  It is
              suggested that the command be a 1mproc  22mwith  the  final  argument
              being 1margs22m.

              Tracing  will be turned off while the command is being executed.
              The values of the 1merrorInfo  22mand  1merrorCode  22mvariables  will  be
              saved  and  restored on return from the command.  It is the com-
              mand's responsibility to preserve all other state.

              If an error occurs during the execution  of  1mcommand22m,  an  error
              message  is  dumped  to stderr and the tracing is disabled.  The
              underlying mechanism that this functionality is  built  on  does
              not support returning an error to the interpreter.

       1mcmdtrace off0m
              Turn off all tracing.

       1mcmdtrace depth0m
              Returns  the  current  maximum  trace level, or zero if trace is
              disabled.
