Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v9 / man / man3 / Tcl_UntraceVar.3
CommitLineData
920dae64
AT
1'\"
2'\" Copyright (c) 1989-1993 The Regents of the University of California.
3'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4'\"
5'\" See the file "license.terms" for information on usage and redistribution
6'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7'\"
8'\" RCS: @(#) $Id: TraceVar.3,v 1.8 2002/08/05 03:24:39 dgp Exp $
9'\"
10'\" The definitions below are for supplemental macros used in Tcl/Tk
11'\" manual entries.
12'\"
13'\" .AP type name in/out ?indent?
14'\" Start paragraph describing an argument to a library procedure.
15'\" type is type of argument (int, etc.), in/out is either "in", "out",
16'\" or "in/out" to describe whether procedure reads or modifies arg,
17'\" and indent is equivalent to second arg of .IP (shouldn't ever be
18'\" needed; use .AS below instead)
19'\"
20'\" .AS ?type? ?name?
21'\" Give maximum sizes of arguments for setting tab stops. Type and
22'\" name are examples of largest possible arguments that will be passed
23'\" to .AP later. If args are omitted, default tab stops are used.
24'\"
25'\" .BS
26'\" Start box enclosure. From here until next .BE, everything will be
27'\" enclosed in one large box.
28'\"
29'\" .BE
30'\" End of box enclosure.
31'\"
32'\" .CS
33'\" Begin code excerpt.
34'\"
35'\" .CE
36'\" End code excerpt.
37'\"
38'\" .VS ?version? ?br?
39'\" Begin vertical sidebar, for use in marking newly-changed parts
40'\" of man pages. The first argument is ignored and used for recording
41'\" the version when the .VS was added, so that the sidebars can be
42'\" found and removed when they reach a certain age. If another argument
43'\" is present, then a line break is forced before starting the sidebar.
44'\"
45'\" .VE
46'\" End of vertical sidebar.
47'\"
48'\" .DS
49'\" Begin an indented unfilled display.
50'\"
51'\" .DE
52'\" End of indented unfilled display.
53'\"
54'\" .SO
55'\" Start of list of standard options for a Tk widget. The
56'\" options follow on successive lines, in four columns separated
57'\" by tabs.
58'\"
59'\" .SE
60'\" End of list of standard options for a Tk widget.
61'\"
62'\" .OP cmdName dbName dbClass
63'\" Start of description of a specific option. cmdName gives the
64'\" option's name as specified in the class command, dbName gives
65'\" the option's name in the option database, and dbClass gives
66'\" the option's class in the option database.
67'\"
68'\" .UL arg1 arg2
69'\" Print arg1 underlined, then print arg2 normally.
70'\"
71'\" RCS: @(#) $Id: man.macros,v 1.4 2000/08/25 06:18:32 ericm Exp $
72'\"
73'\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
74.if t .wh -1.3i ^B
75.nr ^l \n(.l
76.ad b
77'\" # Start an argument description
78.de AP
79.ie !"\\$4"" .TP \\$4
80.el \{\
81. ie !"\\$2"" .TP \\n()Cu
82. el .TP 15
83.\}
84.ta \\n()Au \\n()Bu
85.ie !"\\$3"" \{\
86\&\\$1 \\fI\\$2\\fP (\\$3)
87.\".b
88.\}
89.el \{\
90.br
91.ie !"\\$2"" \{\
92\&\\$1 \\fI\\$2\\fP
93.\}
94.el \{\
95\&\\fI\\$1\\fP
96.\}
97.\}
98..
99'\" # define tabbing values for .AP
100.de AS
101.nr )A 10n
102.if !"\\$1"" .nr )A \\w'\\$1'u+3n
103.nr )B \\n()Au+15n
104.\"
105.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
106.nr )C \\n()Bu+\\w'(in/out)'u+2n
107..
108.AS Tcl_Interp Tcl_CreateInterp in/out
109'\" # BS - start boxed text
110'\" # ^y = starting y location
111'\" # ^b = 1
112.de BS
113.br
114.mk ^y
115.nr ^b 1u
116.if n .nf
117.if n .ti 0
118.if n \l'\\n(.lu\(ul'
119.if n .fi
120..
121'\" # BE - end boxed text (draw box now)
122.de BE
123.nf
124.ti 0
125.mk ^t
126.ie n \l'\\n(^lu\(ul'
127.el \{\
128.\" Draw four-sided box normally, but don't draw top of
129.\" box if the box started on an earlier page.
130.ie !\\n(^b-1 \{\
131\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
132.\}
133.el \}\
134\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
135.\}
136.\}
137.fi
138.br
139.nr ^b 0
140..
141'\" # VS - start vertical sidebar
142'\" # ^Y = starting y location
143'\" # ^v = 1 (for troff; for nroff this doesn't matter)
144.de VS
145.if !"\\$2"" .br
146.mk ^Y
147.ie n 'mc \s12\(br\s0
148.el .nr ^v 1u
149..
150'\" # VE - end of vertical sidebar
151.de VE
152.ie n 'mc
153.el \{\
154.ev 2
155.nf
156.ti 0
157.mk ^t
158\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
159.sp -1
160.fi
161.ev
162.\}
163.nr ^v 0
164..
165'\" # Special macro to handle page bottom: finish off current
166'\" # box/sidebar if in box/sidebar mode, then invoked standard
167'\" # page bottom macro.
168.de ^B
169.ev 2
170'ti 0
171'nf
172.mk ^t
173.if \\n(^b \{\
174.\" Draw three-sided box if this is the box's first page,
175.\" draw two sides but no top otherwise.
176.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
177.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
178.\}
179.if \\n(^v \{\
180.nr ^x \\n(^tu+1v-\\n(^Yu
181\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
182.\}
183.bp
184'fi
185.ev
186.if \\n(^b \{\
187.mk ^y
188.nr ^b 2
189.\}
190.if \\n(^v \{\
191.mk ^Y
192.\}
193..
194'\" # DS - begin display
195.de DS
196.RS
197.nf
198.sp
199..
200'\" # DE - end display
201.de DE
202.fi
203.RE
204.sp
205..
206'\" # SO - start of list of standard options
207.de SO
208.SH "STANDARD OPTIONS"
209.LP
210.nf
211.ta 5.5c 11c
212.ft B
213..
214'\" # SE - end of list of standard options
215.de SE
216.fi
217.ft R
218.LP
219See the \\fBoptions\\fR manual entry for details on the standard options.
220..
221'\" # OP - start of full description for a single option
222.de OP
223.LP
224.nf
225.ta 4c
226Command-Line Name: \\fB\\$1\\fR
227Database Name: \\fB\\$2\\fR
228Database Class: \\fB\\$3\\fR
229.fi
230.IP
231..
232'\" # CS - begin code excerpt
233.de CS
234.RS
235.nf
236.ta .25i .5i .75i 1i
237..
238'\" # CE - end code excerpt
239.de CE
240.fi
241.RE
242..
243.de UL
244\\$1\l'|0\(ul'\\$2
245..
246.TH Tcl_TraceVar 3 7.4 Tcl "Tcl Library Procedures"
247.BS
248.SH NAME
249Tcl_TraceVar, Tcl_TraceVar2, Tcl_UntraceVar, Tcl_UntraceVar2, Tcl_VarTraceInfo, Tcl_VarTraceInfo2 \- monitor accesses to a variable
250.SH SYNOPSIS
251.nf
252\fB#include <tcl.h>\fR
253.sp
254int
255\fBTcl_TraceVar(\fIinterp, varName, flags, proc, clientData\fB)\fR
256.sp
257int
258\fBTcl_TraceVar2(\fIinterp, name1, name2, flags, proc, clientData\fB)\fR
259.sp
260\fBTcl_UntraceVar(\fIinterp, varName, flags, proc, clientData\fB)\fR
261.sp
262\fBTcl_UntraceVar2(\fIinterp, name1, name2, flags, proc, clientData\fB)\fR
263.sp
264ClientData
265\fBTcl_VarTraceInfo(\fIinterp, varName, flags, proc, prevClientData\fB)\fR
266.sp
267ClientData
268\fBTcl_VarTraceInfo2(\fIinterp, name1, name2, flags, proc, prevClientData\fB)\fR
269.SH ARGUMENTS
270.AS Tcl_VarTraceProc prevClientData
271.AP Tcl_Interp *interp in
272Interpreter containing variable.
273.AP "CONST char" *varName in
274Name of variable. May refer to a scalar variable, to
275an array variable with no index, or to an array variable
276with a parenthesized index.
277.AP int flags in
278OR-ed combination of the values TCL_TRACE_READS, TCL_TRACE_WRITES,
279TCL_TRACE_UNSETS, TCL_TRACE_ARRAY, TCL_GLOBAL_ONLY, TCL_NAMESPACE_ONLY,
280TCL_TRACE_RESULT_DYNAMIC and TCL_TRACE_RESULT_OBJECT.
281Not all flags are used by all
282procedures. See below for more information.
283.AP Tcl_VarTraceProc *proc in
284Procedure to invoke whenever one of the traced operations occurs.
285.AP ClientData clientData in
286Arbitrary one-word value to pass to \fIproc\fR.
287.AP "CONST char" *name1 in
288Name of scalar or array variable (without array index).
289.AP "CONST char" *name2 in
290For a trace on an element of an array, gives the index of the
291element. For traces on scalar variables or on whole arrays,
292is NULL.
293.AP ClientData prevClientData in
294If non-NULL, gives last value returned by \fBTcl_VarTraceInfo\fR or
295\fBTcl_VarTraceInfo2\fR, so this call will return information about
296next trace. If NULL, this call will return information about first
297trace.
298.BE
299
300.SH DESCRIPTION
301.PP
302\fBTcl_TraceVar\fR allows a C procedure to monitor and control
303access to a Tcl variable, so that the C procedure is invoked
304whenever the variable is read or written or unset.
305If the trace is created successfully then \fBTcl_TraceVar\fR returns
306TCL_OK. If an error occurred (e.g. \fIvarName\fR specifies an element
307of an array, but the actual variable isn't an array) then TCL_ERROR
308is returned and an error message is left in the interpreter's result.
309.PP
310The \fIflags\fR argument to \fBTcl_TraceVar\fR indicates when the
311trace procedure is to be invoked and provides information
312for setting up the trace. It consists of an OR-ed combination
313of any of the following values:
314.TP
315\fBTCL_GLOBAL_ONLY\fR
316Normally, the variable will be looked up at the current level of
317procedure call; if this bit is set then the variable will be looked
318up at global level, ignoring any active procedures.
319.TP
320\fBTCL_NAMESPACE_ONLY\fR
321Normally, the variable will be looked up at the current level of
322procedure call; if this bit is set then the variable will be looked
323up in the current namespace, ignoring any active procedures.
324.TP
325\fBTCL_TRACE_READS\fR
326Invoke \fIproc\fR whenever an attempt is made to read the variable.
327.TP
328\fBTCL_TRACE_WRITES\fR
329Invoke \fIproc\fR whenever an attempt is made to modify the variable.
330.TP
331\fBTCL_TRACE_UNSETS\fR
332Invoke \fIproc\fR whenever the variable is unset.
333A variable may be unset either explicitly by an \fBunset\fR command,
334or implicitly when a procedure returns (its local variables are
335automatically unset) or when the interpreter is deleted (all
336variables are automatically unset).
337.TP
338\fBTCL_TRACE_ARRAY\fR
339Invoke \fIproc\fR whenever the array command is invoked.
340This gives the trace procedure a chance to update the array before
341array names or array get is called. Note that this is called
342before an array set, but that will trigger write traces.
343.VS 8.4
344.TP
345\fBTCL_TRACE_RESULT_DYNAMIC\fR
346The result of invoking the \fIproc\fR is a dynamically allocated
347string that will be released by the Tcl library via a call to
348\fBckfree\fR. Must not be specified at the same time as
349TCL_TRACE_RESULT_OBJECT.
350.TP
351\fBTCL_TRACE_RESULT_OBJECT\fR
352The result of invoking the \fIproc\fR is a Tcl_Obj* (cast to a char*)
353with a reference count of at least one. The ownership of that
354reference will be transferred to the Tcl core for release (when the
355core has finished with it) via a call to \fBTcl_DecrRefCount\fR. Must
356not be specified at the same time as TCL_TRACE_RESULT_DYNAMIC.
357.VE 8.4
358.PP
359Whenever one of the specified operations occurs on the variable,
360\fIproc\fR will be invoked.
361It should have arguments and result that match the type
362\fBTcl_VarTraceProc\fR:
363.CS
364typedef char *Tcl_VarTraceProc(
365 ClientData \fIclientData\fR,
366 Tcl_Interp *\fIinterp\fR,
367 char *\fIname1\fR,
368 char *\fIname2\fR,
369 int \fIflags\fR);
370.CE
371The \fIclientData\fR and \fIinterp\fR parameters will
372have the same values as those passed to \fBTcl_TraceVar\fR when the
373trace was created.
374\fIClientData\fR typically points to an application-specific
375data structure that describes what to do when \fIproc\fR
376is invoked.
377\fIName1\fR and \fIname2\fR give the name of the traced variable
378in the normal two-part form (see the description of \fBTcl_TraceVar2\fR
379below for details).
380\fIFlags\fR is an OR-ed combination of bits providing several
381pieces of information.
382One of the bits TCL_TRACE_READS, TCL_TRACE_WRITES, TCL_TRACE_ARRAY,
383or TCL_TRACE_UNSETS
384will be set in \fIflags\fR to indicate which operation is being performed
385on the variable.
386The bit TCL_GLOBAL_ONLY will be set whenever the variable being
387accessed is a global one not accessible from the current level of
388procedure call: the trace procedure will need to pass this flag
389back to variable-related procedures like \fBTcl_GetVar\fR if it
390attempts to access the variable.
391The bit TCL_NAMESPACE_ONLY will be set whenever the variable being
392accessed is a namespace one not accessible from the current level of
393procedure call: the trace procedure will need to pass this flag
394back to variable-related procedures like \fBTcl_GetVar\fR if it
395attempts to access the variable.
396The bit TCL_TRACE_DESTROYED will be set in \fIflags\fR if the trace is
397about to be destroyed; this information may be useful to \fIproc\fR
398so that it can clean up its own internal data structures (see
399the section TCL_TRACE_DESTROYED below for more details).
400Lastly, the bit TCL_INTERP_DESTROYED will be set if the entire
401interpreter is being destroyed.
402When this bit is set, \fIproc\fR must be especially careful in
403the things it does (see the section TCL_INTERP_DESTROYED below).
404The trace procedure's return value should normally be NULL; see
405ERROR RETURNS below for information on other possibilities.
406.PP
407\fBTcl_UntraceVar\fR may be used to remove a trace.
408If the variable specified by \fIinterp\fR, \fIvarName\fR, and \fIflags\fR
409has a trace set with \fIflags\fR, \fIproc\fR, and
410\fIclientData\fR, then the corresponding trace is removed.
411If no such trace exists, then the call to \fBTcl_UntraceVar\fR
412has no effect.
413The same bits are valid for \fIflags\fR as for calls to \fBTcl_TraceVar\fR.
414.PP
415\fBTcl_VarTraceInfo\fR may be used to retrieve information about
416traces set on a given variable.
417The return value from \fBTcl_VarTraceInfo\fR is the \fIclientData\fR
418associated with a particular trace.
419The trace must be on the variable specified by the \fIinterp\fR,
420\fIvarName\fR, and \fIflags\fR arguments (only the TCL_GLOBAL_ONLY and
421TCL_NAMESPACE_ONLY bits from \fIflags\fR is used; other bits are
422ignored) and its trace procedure must the same as the \fIproc\fR
423argument.
424If the \fIprevClientData\fR argument is NULL then the return
425value corresponds to the first (most recently created) matching
426trace, or NULL if there are no matching traces.
427If the \fIprevClientData\fR argument isn't NULL, then it should
428be the return value from a previous call to \fBTcl_VarTraceInfo\fR.
429In this case, the new return value will correspond to the next
430matching trace after the one whose \fIclientData\fR matches
431\fIprevClientData\fR, or NULL if no trace matches \fIprevClientData\fR
432or if there are no more matching traces after it.
433This mechanism makes it possible to step through all of the
434traces for a given variable that have the same \fIproc\fR.
435
436.SH "TWO-PART NAMES"
437.PP
438The procedures \fBTcl_TraceVar2\fR, \fBTcl_UntraceVar2\fR, and
439\fBTcl_VarTraceInfo2\fR are identical to \fBTcl_TraceVar\fR,
440\fBTcl_UntraceVar\fR, and \fBTcl_VarTraceInfo\fR, respectively,
441except that the name of the variable consists of two parts.
442\fIName1\fR gives the name of a scalar variable or array,
443and \fIname2\fR gives the name of an element within an array.
444.VS 8.1
445When \fIname2\fR is NULL,
446\fIname1\fR may contain both an array and an element name:
447if the name contains an open parenthesis and ends with a
448close parenthesis, then the value between the parentheses is
449treated as an element name (which can have any string value) and
450the characters before the first open
451parenthesis are treated as the name of an array variable.
452If \fIname2\fR is NULL and \fIname1\fR does not refer
453to an array element
454.VE
455it means that either the variable is
456a scalar or the trace is to be set on the entire array rather
457than an individual element (see WHOLE-ARRAY TRACES below for
458more information).
459
460
461.SH "ACCESSING VARIABLES DURING TRACES"
462.PP
463During read, write, and array traces, the
464trace procedure can read, write, or unset the traced
465variable using \fBTcl_GetVar2\fR, \fBTcl_SetVar2\fR, and
466other procedures.
467While \fIproc\fR is executing, traces are temporarily disabled
468for the variable, so that calls to \fBTcl_GetVar2\fR and
469\fBTcl_SetVar2\fR will not cause \fIproc\fR or other trace procedures
470to be invoked again.
471Disabling only occurs for the variable whose trace procedure
472is active; accesses to other variables will still be traced.
473However, if a variable is unset during a read or write trace then unset
474traces will be invoked.
475.PP
476During unset traces the variable has already been completely
477expunged.
478It is possible for the trace procedure to read or write the
479variable, but this will be a new version of the variable.
480Traces are not disabled during unset traces as they are for
481read and write traces, but existing traces have been removed
482from the variable before any trace procedures are invoked.
483If new traces are set by unset trace procedures, these traces
484will be invoked on accesses to the variable by the trace
485procedures.
486
487.SH "CALLBACK TIMING"
488.PP
489When read tracing has been specified for a variable, the trace
490procedure will be invoked whenever the variable's value is
491read. This includes \fBset\fR Tcl commands, \fB$\fR-notation
492in Tcl commands, and invocations of the \fBTcl_GetVar\fR
493and \fBTcl_GetVar2\fR procedures.
494\fIProc\fR is invoked just before the variable's value is
495returned.
496It may modify the value of the variable to affect what
497is returned by the traced access.
498If it unsets the variable then the access will return an error
499just as if the variable never existed.
500.PP
501When write tracing has been specified for a variable, the
502trace procedure will be invoked whenever the variable's value
503is modified. This includes \fBset\fR commands,
504commands that modify variables as side effects (such as
505\fBcatch\fR and \fBscan\fR), and calls to the \fBTcl_SetVar\fR
506and \fBTcl_SetVar2\fR procedures).
507\fIProc\fR will be invoked after the variable's value has been
508modified, but before the new value of the variable has been
509returned.
510It may modify the value of the variable to override the change
511and to determine the value actually returned by the traced
512access.
513If it deletes the variable then the traced access will return
514an empty string.
515.PP
516When array tracing has been specified, the trace procedure
517will be invoked at the beginning of the array command implementation,
518before any of the operations like get, set, or names have been invoked.
519The trace procedure can modify the array elements with \fBTcl_SetVar\fR
520and \fBTcl_SetVar2\fR.
521.PP
522When unset tracing has been specified, the trace procedure
523will be invoked whenever the variable is destroyed.
524The traces will be called after the variable has been
525completely unset.
526
527.SH "WHOLE-ARRAY TRACES"
528.PP
529If a call to \fBTcl_TraceVar\fR or \fBTcl_TraceVar2\fR specifies
530the name of an array variable without an index into the array,
531then the trace will be set on the array as a whole.
532This means that \fIproc\fR will be invoked whenever any
533element of the array is accessed in the ways specified by
534\fIflags\fR.
535When an array is unset, a whole-array trace will be invoked
536just once, with \fIname1\fR equal to the name of the array
537and \fIname2\fR NULL; it will not be invoked once for each
538element.
539
540.SH "MULTIPLE TRACES"
541.PP
542It is possible for multiple traces to exist on the same variable.
543When this happens, all of the trace procedures will be invoked on each
544access, in order from most-recently-created to least-recently-created.
545When there exist whole-array traces for an array as well as
546traces on individual elements, the whole-array traces are invoked
547before the individual-element traces.
548If a read or write trace unsets the variable then all of the unset
549traces will be invoked but the remainder of the read and write traces
550will be skipped.
551
552.SH "ERROR RETURNS"
553.PP
554Under normal conditions trace procedures should return NULL, indicating
555successful completion.
556If \fIproc\fR returns a non-NULL value it signifies that an
557error occurred.
558The return value must be a pointer to a static character string
559containing an error message,
560.VS 8.4
561unless (\fIexactly\fR one of) the TCL_TRACE_RESULT_DYNAMIC and
562TCL_TRACE_RESULT_OBJECT flags is set, which specify that the result is
563either a dynamic string (to be released with \fBckfree\fR) or a
564Tcl_Obj* (cast to char* and to be released with
565\fBTcl_DecrRefCount\fR) containing the error message.
566.VE 8.4
567If a trace procedure returns an error, no further traces are
568invoked for the access and the traced access aborts with the
569given message.
570Trace procedures can use this facility to make variables
571read-only, for example (but note that the value of the variable
572will already have been modified before the trace procedure is
573called, so the trace procedure will have to restore the correct
574value).
575.PP
576The return value from \fIproc\fR is only used during read and
577write tracing.
578During unset traces, the return value is ignored and all relevant
579trace procedures will always be invoked.
580
581.SH "RESTRICTIONS"
582.PP
583A trace procedure can be called at any time, even when there
584is a partially-formed result in the interpreter's result area. If
585the trace procedure does anything that could damage this result (such
586as calling \fBTcl_Eval\fR) then it must save the original values of
587the interpreter's \fBresult\fR and \fBfreeProc\fR fields and restore
588them before it returns.
589
590.SH "UNDEFINED VARIABLES"
591.PP
592It is legal to set a trace on an undefined variable.
593The variable will still appear to be undefined until the
594first time its value is set.
595If an undefined variable is traced and then unset, the unset will fail
596with an error (``no such variable''), but the trace
597procedure will still be invoked.
598
599.SH "TCL_TRACE_DESTROYED FLAG"
600.PP
601In an unset callback to \fIproc\fR, the TCL_TRACE_DESTROYED bit
602is set in \fIflags\fR if the trace is being removed as part
603of the deletion.
604Traces on a variable are always removed whenever the variable
605is deleted; the only time TCL_TRACE_DESTROYED isn't set is for
606a whole-array trace invoked when only a single element of an
607array is unset.
608
609.SH "TCL_INTERP_DESTROYED"
610.PP
611When an interpreter is destroyed, unset traces are called for
612all of its variables.
613The TCL_INTERP_DESTROYED bit will be set in the \fIflags\fR
614argument passed to the trace procedures.
615Trace procedures must be extremely careful in what they do if
616the TCL_INTERP_DESTROYED bit is set.
617It is not safe for the procedures to invoke any Tcl procedures
618on the interpreter, since its state is partially deleted.
619All that trace procedures should do under these circumstances is
620to clean up and free their own internal data structures.
621
622.SH BUGS
623.PP
624Tcl doesn't do any error checking to prevent trace procedures
625from misusing the interpreter during traces with TCL_INTERP_DESTROYED
626set.
627.PP
628Array traces are not yet integrated with the Tcl "info exists" command,
629nor is there Tcl-level access to array traces.
630
631.SH KEYWORDS
632clientData, trace, variable