1 | <HTML> |
---|
2 | <HEAD> |
---|
3 | <TITLE>tkcon: observe procedure</TITLE> |
---|
4 | <LINK REL="STYLESHEET" TYPE="text/css" HREF="./style.css"> |
---|
5 | </HEAD> |
---|
6 | |
---|
7 | <BODY BGCOLOR=#FFFFFF> |
---|
8 | |
---|
9 | <TABLE WIDTH=100% BORDER=0 CELLSPACING=2 CELLPADDING=0 BGCOLOR=#000000><TR><TD> |
---|
10 | <!-- start header info --> |
---|
11 | <TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=#FFFFFF> |
---|
12 | <TR> |
---|
13 | <TH><FONT SIZE=+3>tkcon: <CODE>observe</CODE> procedure</FONT></TH> |
---|
14 | <TD align=right> |
---|
15 | <A href="http://tkcon.sourceforge.net/"> |
---|
16 | <IMG src="http://sourceforge.net/sflogo.php?group_id=11462&type=1" width="88" |
---|
17 | height="31" border="0" alt="SourceForge Logo"></A> |
---|
18 | </TD> |
---|
19 | </TR> |
---|
20 | </TABLE> |
---|
21 | <!-- end header info --> |
---|
22 | |
---|
23 | </TD></TR><TR><TD> |
---|
24 | <!-- start main navigation table --> |
---|
25 | <TABLE BORDER=1 CELLPADDING=2 CELLSPACING=2 BGCOLOR=#CCCCCC width=100%> |
---|
26 | <TR> |
---|
27 | <TH CLASS="hi"><A HREF="index.html" CLASS="hi">Documentation</A></TH> |
---|
28 | <TH><A HREF="purpose.html">Purpose & Features</A></TH> |
---|
29 | <TH><A HREF="limits.html">Limitations</A></TH> |
---|
30 | <TH><A HREF="todo.html">To Do</A></TH> |
---|
31 | <TH><A HREF="license.terms">License</A></TH> |
---|
32 | </TR><TR> |
---|
33 | <TH COLSPAN=2><A HREF="plugin.html">Online Demo</A> |
---|
34 | (requires <A HREF="http://tcl.activestate.com/software/plugin/">Tk plugin</A>)</TH> |
---|
35 | <TH COLSPAN=3><A HREF="nontcl.html">Using TkCon with other Tk Languages</A></TH> |
---|
36 | </TR> |
---|
37 | </TABLE> |
---|
38 | <!-- end main navigation table --> |
---|
39 | </TD></TR><TR><TD> |
---|
40 | <!-- start secondary navigation table --> |
---|
41 | <TABLE BORDER=1 CELLPADDING=2 CELLSPACING=2 BGCOLOR=#BBBBBB width=100%> |
---|
42 | <TR> |
---|
43 | <TH><A HREF="start.html">Getting Started</A></TH> |
---|
44 | <TH><A HREF="bindings.html">Special Bindings</A></TH> |
---|
45 | <TH><A HREF="procs.html">Procedures</A></TH> |
---|
46 | <TH><A HREF="demopic.gif">Screenshot</A></TH> |
---|
47 | </TR> |
---|
48 | <TR> |
---|
49 | <TH><A HREF="dump.html"><CODE>dump</CODE></A></TH> |
---|
50 | <TH><A HREF="tkcon.html"><CODE>tkcon</CODE></A></TH> |
---|
51 | <TH><A HREF="idebug.html"><CODE>idebug</CODE></A></TH> |
---|
52 | <TH CLASS="hi2"><A HREF="observe.html" CLASS="hi2"><CODE>observe</CODE></A></TH> |
---|
53 | </TR> |
---|
54 | </TABLE> |
---|
55 | <!-- end secondary navigation table --> |
---|
56 | </TD></TR><TR><TD BGCOLOR=#FFFFFF> |
---|
57 | <DIV CLASS="indent"> |
---|
58 | <P> |
---|
59 | This command provides runtime debugging output for variables and commands |
---|
60 | without the need to edit your code. For variables, the underlying mechanism |
---|
61 | uses <code>trace</code> and <code>dump var</code>. For commands, it renames |
---|
62 | the observed procedure and uses a special wrapper procedure. <b><font |
---|
63 | color="#FF0000">WARNING:</font></b> using this procedure after checkpointing |
---|
64 | state will result in major problems if you clean state because the renamed |
---|
65 | (true) commands will be lost. |
---|
66 | <P> |
---|
67 | |
---|
68 | This procedure is experimental. Comments are encouraged. |
---|
69 | |
---|
70 | <DL> |
---|
71 | |
---|
72 | <DT> <CODE>observe <b>command</b></CODE> <I>cmdname ?maxlevel?</I> |
---|
73 | <DD> This will create a wrapper command which prints out (using |
---|
74 | <code>dump</code>) the call stack to the console. <i>maxlevel</i> |
---|
75 | represents the maximum number of levels of the call stack which will be |
---|
76 | printed (defaults to 4). |
---|
77 | |
---|
78 | <DT> <CODE>observe <b>cdelete</b></CODE> <I>cmdname</I> |
---|
79 | <DD> Removes the wrapper around an observed command. |
---|
80 | |
---|
81 | <DT> <CODE>observe <b>cinfo</b></CODE> <I>cmdname</I> |
---|
82 | <DD> Prints out useless info. |
---|
83 | |
---|
84 | <DT> <CODE>observe <b>variable</b></CODE> <I>varname operation ?args?</I> |
---|
85 | <DD> Currently a wrapper around trace that uses <code>dump</code> to |
---|
86 | print out the value of the named variable whenever the specified operation |
---|
87 | on that variable occurs (must be read, write or unset). |
---|
88 | |
---|
89 | <DT> <CODE>observe <b>vdelete</b></CODE> <I>varname operation</I> |
---|
90 | <DD> Deletes the trace wrapper around the named variable. |
---|
91 | |
---|
92 | <DT> <CODE>observe <b>vinfo</b></CODE> <I>varname</I> |
---|
93 | <DD> Prints out trace info about the named variable. |
---|
94 | |
---|
95 | </DL> |
---|
96 | </DIV> |
---|
97 | </TD></TR></TABLE> |
---|
98 | |
---|
99 | <HR NOSHADE SIZE=1> |
---|
100 | <ADDRESS><FONT SIZE=2>© |
---|
101 | <A HREF="mailto:jeff.hobbs@acm.org">Jeffrey Hobbs</A></FONT></ADDRESS> |
---|
102 | |
---|
103 | </BODY> |
---|
104 | </HTML> |
---|