summaryrefslogtreecommitdiffstats
path: root/doc/trace.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2008-10-17 10:22:24 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2008-10-17 10:22:24 (GMT)
commit842e3ff91428c72a2ce0d4df4889778af82f4b12 (patch)
tree5a94240e321022019f593f6bd712833ab12138c6 /doc/trace.n
parent8b464633a0f2df93912ad25af65a5724cd643da2 (diff)
downloadtcl-842e3ff91428c72a2ce0d4df4889778af82f4b12.zip
tcl-842e3ff91428c72a2ce0d4df4889778af82f4b12.tar.gz
tcl-842e3ff91428c72a2ce0d4df4889778af82f4b12.tar.bz2
Improve clarity of formatting.
Diffstat (limited to 'doc/trace.n')
-rw-r--r--doc/trace.n17
1 files changed, 16 insertions, 1 deletions
diff --git a/doc/trace.n b/doc/trace.n
index 88a9e81..37e5532 100644
--- a/doc/trace.n
+++ b/doc/trace.n
@@ -6,7 +6,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: trace.n,v 1.26 2007/12/13 15:22:33 dgp Exp $
+'\" RCS: @(#) $Id: trace.n,v 1.27 2008/10/17 10:22:25 dkf Exp $
'\"
.so man.macros
.TH trace n "8.4" Tcl "Tcl Built-In Commands"
@@ -56,9 +56,11 @@ execute them.
When the trace triggers, depending on the operations being traced, a number of
arguments are appended to \fIcommandPrefix\fR so that the actual command is as
follows:
+.PP
.CS
\fIcommandPrefix oldName newName op\fR
.CE
+.PP
\fIOldName\fR and \fInewName\fR give the traced command's current (old) name,
and the name to which it is being renamed (the empty string if this is a
.QW delete
@@ -123,9 +125,11 @@ number of arguments are appended to \fIcommandPrefix\fR so that the actual
command is as follows:
.PP
For \fBenter\fR and \fBenterstep\fR operations:
+.PP
.CS
\fIcommandPrefix command-string op\fR
.CE
+.PP
\fICommand-string\fR gives the complete current command being
executed (the traced command for a \fBenter\fR operation, an
arbitrary command for a \fBenterstep\fR operation), including
@@ -139,9 +143,11 @@ course when the command is subsequently executed, an
error will occur.
.PP
For \fBleave\fR and \fBleavestep\fR operations:
+.PP
.CS
\fIcommand command-string code result op\fR
.CE
+.PP
\fICommand-string\fR gives the complete current command being
executed (the traced command for a \fBenter\fR operation, an
arbitrary command for a \fBenterstep\fR operation), including
@@ -219,9 +225,11 @@ interpreter in which to execute them.
.PP
When the trace triggers, three arguments are appended to
\fIcommandPrefix\fR so that the actual command is as follows:
+.PP
.CS
\fIcommandPrefix name1 name2 op\fR
.CE
+.PP
\fIName1\fR and \fIname2\fR give the name(s) for the variable
being accessed: if the variable is a scalar then \fIname1\fR
gives the variable's name and \fIname2\fR is an empty string;
@@ -370,9 +378,11 @@ future version of Tcl. They use an older syntax in which \fBarray\fR,
list, but simply a string concatenation of the operations, such as
\fBrwua\fR.
.SH EXAMPLES
+.PP
Print a message whenever either of the global variables \fBfoo\fR and
\fBbar\fR are updated, even if they have a different local name at the
time (which can be done with the \fBupvar\fR command):
+.PP
.CS
proc tracer {varname args} {
upvar #0 $varname var
@@ -384,6 +394,7 @@ proc tracer {varname args} {
.PP
Ensure that the global variable \fBfoobar\fR always contains the
product of the global variables \fBfoo\fR and \fBbar\fR:
+.PP
.CS
proc doMult args {
global foo bar foobar
@@ -395,6 +406,7 @@ proc doMult args {
.PP
Print a trace of what commands are executed during the processing of a Tcl
procedure:
+.PP
.CS
proc x {} { y }
proc y {} { z }
@@ -411,3 +423,6 @@ x
set(n), unset(n)
.SH KEYWORDS
read, command, rename, variable, write, trace, unset
+.\" Local Variables:
+.\" mode: nroff
+.\" End: