dp_traceProc, dp_untraceProc - procedure tracing facilities


dp_traceProc procedure command
Sets up a procedure trace on procedure and returns a trace id to identify the new procedure trace. Procedure may be an abbrevation. In any furthur evaluation of Tcl code, right before any procedure whose name starts with the string procedure is evaluated, command is evaluated with the arguments of the trace id, the level of nesting, and the command line that was to be evaluated before the procedure trace interrupted.

Example usage:

proc PrintTrace {traceId level args} {
        set fmtstr "%[set level]s"
        puts stdout "[format $fmtstr ""] $args"
}

dp_traceProc e PrintTrace;
From now on, all commands starting with the character "e" will be traced.
dp_untraceProc traceId
Removes the procedure trace defined by traceId.
Brian Smith (bsmith@cs.berkeley.edu)
Steve Yen (syen@cs.berkeley.edu)
Stephen Tu (tus@roger-rabbit.cs.berkeley.edu)