summaryrefslogtreecommitdiff
path: root/systems/mac/support/alpha/tcl/extensions/trace.diff
blob: 679b12527ef07b4de8d15069c653e263a10e136e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
diff -C 3 -r -X traceignore.txt tcl8.2/generic/tcl.decls tcl8.2orig/generic/tcl.decls
*** tcl8.2/generic/tcl.decls	Sat Sep 18 19:52:50 1999
--- tcl8.2orig/generic/tcl.decls	Wed Aug 18 20:59:08 1999
***************
*** 1343,1353 ****
  declare 389 generic {
      int Tcl_GetChannelNamesEx(Tcl_Interp *interp, char *pattern)
  }
! declare 390 generic {
!     Tcl_Trace Tcl_CreateTraceObj(Tcl_Interp* interp, Tcl_Obj* insideCmd, \
! 	    int traceFlags, int maxLevel, int minLevel, \
! 	    Tcl_CmdTraceObjProc *proc, ClientData clientData)
! }
  
  
  ##############################################################################
--- 1343,1349 ----
  declare 389 generic {
      int Tcl_GetChannelNamesEx(Tcl_Interp *interp, char *pattern)
  }
! 
  
  
  ##############################################################################
diff -C 3 -r -X traceignore.txt tcl8.2/generic/tcl.h tcl8.2orig/generic/tcl.h
*** tcl8.2/generic/tcl.h	Tue Sep 21 09:03:50 1999
--- tcl8.2orig/generic/tcl.h	Tue Aug 10 17:16:25 1999
***************
*** 503,512 ****
  typedef void (Tcl_CmdTraceProc) _ANSI_ARGS_((ClientData clientData,
  	Tcl_Interp *interp, int level, char *command, Tcl_CmdProc *proc,
  	ClientData cmdClientData, int argc, char *argv[]));
- typedef void (Tcl_CmdTraceObjProc) _ANSI_ARGS_((ClientData clientData,
- 	Tcl_Interp *interp, int level, int startLevel, int flags, int code,
- 	char* command, int length, Tcl_Command currentCmd, 
- 	int objc, struct Tcl_Obj *CONST objv[]));
  typedef void (Tcl_DupInternalRepProc) _ANSI_ARGS_((struct Tcl_Obj *srcPtr, 
          struct Tcl_Obj *dupPtr));
  typedef int (Tcl_EncodingConvertProc)_ANSI_ARGS_((ClientData clientData,
--- 503,508 ----
***************
*** 867,878 ****
  #define TCL_INTERP_DESTROYED	 0x100
  #define TCL_LEAVE_ERR_MSG	 0x200
  #define TCL_TRACE_ARRAY		 0x800
- 
- /*
-  * Flag values passed to Tcl_CreateTraceObj
-  */
- #define TCL_CMD_TRACE_BEFORE	1
- #define TCL_CMD_TRACE_AFTER	2
  
  /*
   * The TCL_PARSE_PART1 flag is deprecated and has no effect. 
--- 863,868 ----
diff -C 3 -r -X traceignore.txt tcl8.2/generic/tclBasic.c tcl8.2orig/generic/tclBasic.c
*** tcl8.2/generic/tclBasic.c	Tue Sep 21 12:28:02 1999
--- tcl8.2orig/generic/tclBasic.c	Fri May 14 17:16:54 1999
***************
*** 3837,3964 ****
      tracePtr = (Trace *) ckalloc(sizeof(Trace));
      tracePtr->level = level;
      tracePtr->proc = proc;
-     tracePtr->traceFlags = 0;
      tracePtr->clientData = clientData;
-     tracePtr->nextPtr = iPtr->tracePtr;
-     iPtr->tracePtr = tracePtr;
- 
-     return (Tcl_Trace) tracePtr;
- }
- 
- /*
-  *----------------------------------------------------------------------
-  *
-  * Tcl_CreateTraceObj --
-  *
-  *	Arrange for a procedure to be called to trace command execution.
-  *
-  * Results:
-  *	The return value is a token for the trace, which may be passed
-  *	to Tcl_DeleteTrace to eliminate the trace.
-  *
-  * Side effects:
-  *	From now on, proc will be called just before a command procedure
-  *	is called to execute a Tcl command, provided certain conditions
-  *	are met.  These conditions may include: current execution
-  *	level is at least 'minLevel'; current execution level is at
-  *	most 'maxLevel'; execution is currently inside the command/proc
-  *	'insideCmd'.  For any given occasion on which those conditions
-  *	are met, there are two times at which this procedure may
-  *	be called: before the command is executed, and after the
-  *	command is executed.  Depending on the value to 'traceFlags'
-  *	the procedure will be called in one or both of those situations.
-  *	
-  *	Calls to proc will have the following form:
-  *
-  *	void
-  *	proc(clientData, interp, level, startLevel, flags, code,
-  *	        command, length, currentCmd, objc, objv)
-  *	    ClientData clientData;
-  *	    Tcl_Interp *interp;
-  *	    int level;
-  *	    int startLevel;
-  *	    int flags;
-  *	    int code;
-  *	    char *command;
-  *	    int length;
-  *	    Tcl_Command currentCmd;
-  *	    int objc;
-  *	    struct Tcl_Obj *CONST objv[];
-  *	{
-  *	}
-  *
-  *	The clientData, interp and flags arguments to proc will be the
-  *	same as the corresponding arguments to this procedure.  Level
-  *	gives the nesting level of command interpretation for this
-  *	interpreter (0 corresponds to top level).  StartLevel gives the
-  *	level at which the first command trace was triggered (so
-  *	Level-StartLevel gives a relative level).  The first 'length'
-  *	characters of Command gives the ASCII text of the raw command,
-  *	and currentCmd is the Tcl_Command structure referring to the
-  *	current command.  will receive, and objc and objv give the
-  *	arguments to the command, after any argument parsing and
-  *	substitution.  Proc does not return a value.
-  *
-  *----------------------------------------------------------------------
-  */
- 
- Tcl_Trace
- Tcl_CreateTraceObj(interp, insideCmd, traceFlags, maxLevel, minLevel, 
- 		   proc, clientData)
-     Tcl_Interp *interp;		/* Interpreter in which to create trace. */
-     Tcl_Obj* insideCmd;		/* Only activate this trace when execution
-                  		 * is inside a call to this command, and
-                  		 * after it is inside, later deactivate the 
-                  		 * trace when execution of this command is
-                  		 * complete. */
-     int traceFlags;		/* Or'd combination of TCL_CMD_TRACE_ flags,
-     				 * to indicate whether to call the given
-     				 * procedure before command execution,
-     				 * or after command execution (with the
-     				 * result of the command execution). If
-     				 * zero, then equivalent to the default
-     				 * of tracing before and after. */
-     int maxLevel;		/* Only call proc for commands at nesting
- 				 * level<=argument level (1=>top level). 
- 				 * If zero, then ignore minimum level. */
-     int minLevel;		/* Only call proc for commands at nesting
- 				 * level>=argument level (1=>top level). 
- 				 * If zero then ignore maximum level. */
-     Tcl_CmdTraceObjProc *proc;	/* Procedure to call before executing each
- 				 * command. */
-     ClientData clientData;	/* Arbitrary value word to pass to proc. */
- {
-     register Trace *tracePtr;
-     register Interp *iPtr = (Interp *) interp;
- 
-     /*
-      * Invalidate existing compiled code for this interpreter and arrange
-      * (by setting the DONT_COMPILE_CMDS_INLINE flag) that when compiling
-      * new code, no commands will be compiled inline (i.e., into an inline
-      * sequence of instructions). We do this because commands that were
-      * compiled inline will never result in a command trace being called.
-      */
- 
-     iPtr->compileEpoch++;
-     iPtr->flags |= DONT_COMPILE_CMDS_INLINE;
- 
-     tracePtr = (Trace *) ckalloc(sizeof(Trace));
-     tracePtr->level = minLevel;
-     tracePtr->objProc = proc;
-     if((traceFlags & 3) == 0) {
- 	tracePtr->traceFlags = TCL_CMD_TRACE_BEFORE | TCL_CMD_TRACE_AFTER;
-     } else {
- 	tracePtr->traceFlags = traceFlags & 3;
-     }
-     tracePtr->clientData = clientData;
-     tracePtr->minLevel = minLevel;
-     tracePtr->cmdPtr = NULL;
-     if(insideCmd != NULL) {
- 	tracePtr->cmdPtr = Tcl_FindCommand(interp,
- 	      Tcl_GetString(insideCmd), (Tcl_Namespace *) NULL, /*flags*/ 0);
-     }
-     tracePtr->tracingCmdDepth = 0;
-     tracePtr->tracingInitialDepth = 0;
      tracePtr->nextPtr = iPtr->tracePtr;
      iPtr->tracePtr = tracePtr;
  
--- 3837,3843 ----
diff -C 3 -r -X traceignore.txt tcl8.2/generic/tclExecute.c tcl8.2orig/generic/tclExecute.c
*** tcl8.2/generic/tclExecute.c	Wed Sep 22 18:55:43 1999
--- tcl8.2orig/generic/tclExecute.c	Wed Jun 16 15:56:33 1999
***************
*** 208,214 ****
  static void		CallTraceProcedure _ANSI_ARGS_((Tcl_Interp *interp,
  			    Trace *tracePtr, Command *cmdPtr,
  			    char *command, int numChars,
! 			    int objc, Tcl_Obj *CONST objv[]));
  static void		DupCmdNameInternalRep _ANSI_ARGS_((Tcl_Obj *objPtr,
  			    Tcl_Obj *copyPtr));
  static int		ExprAbsFunc _ANSI_ARGS_((Tcl_Interp *interp,
--- 208,214 ----
  static void		CallTraceProcedure _ANSI_ARGS_((Tcl_Interp *interp,
  			    Trace *tracePtr, Command *cmdPtr,
  			    char *command, int numChars,
! 			    int objc, Tcl_Obj *objv[]));
  static void		DupCmdNameInternalRep _ANSI_ARGS_((Tcl_Obj *objPtr,
  			    Tcl_Obj *copyPtr));
  static int		ExprAbsFunc _ANSI_ARGS_((Tcl_Interp *interp,
***************
*** 726,737 ****
  	    
  	    doInvocation:
  	    {
! 		int objc = opnd;   /* The number of arguments. */
! 		Tcl_Obj **objv;	   /* The array of argument objects. */
! 		Command *cmdPtr;   /* Points to command's Command struct. */
! 		int newPcOffset;   /* New inst offset for break, continue. */
! 		char *command;     /* String starting with actual command */
! 		int numChars;      /* Number of chars of command to use */
  #ifdef TCL_COMPILE_DEBUG
  		int isUnknownCmd = 0;
  		char cmdNameBuf[21];
--- 726,735 ----
  	    
  	    doInvocation:
  	    {
! 		int objc = opnd; /* The number of arguments. */
! 		Tcl_Obj **objv;	 /* The array of argument objects. */
! 		Command *cmdPtr; /* Points to command's Command struct. */
! 		int newPcOffset; /* New inst offset for break, continue. */
  #ifdef TCL_COMPILE_DEBUG
  		int isUnknownCmd = 0;
  		char cmdNameBuf[21];
***************
*** 789,799 ****
  		 */
  
  		if (iPtr->tracePtr != NULL) {
! 		    command = GetSrcInfoForPc(pc, codePtr, &numChars);
! 		    DECACHE_STACK_INFO();
! 		    TclCheckTraces(interp,command,numChars,cmdPtr,TCL_OK,
! 				   TCL_CMD_TRACE_BEFORE,objc,objv);
! 		    CACHE_STACK_INFO();
  		}
  		
  		/*
--- 787,809 ----
  		 */
  
  		if (iPtr->tracePtr != NULL) {
! 		    Trace *tracePtr, *nextTracePtr;
! 
! 		    for (tracePtr = iPtr->tracePtr;  tracePtr != NULL;
! 		            tracePtr = nextTracePtr) {
! 			nextTracePtr = tracePtr->nextPtr;
! 			if (iPtr->numLevels <= tracePtr->level) {
! 			    int numChars;
! 			    char *cmd = GetSrcInfoForPc(pc, codePtr,
! 				    &numChars);
! 			    if (cmd != NULL) {
! 				DECACHE_STACK_INFO();
! 				CallTraceProcedure(interp, tracePtr, cmdPtr,
! 				        cmd, numChars, objc, objv);
! 				CACHE_STACK_INFO();
! 			    }
! 			}
! 		    }
  		}
  		
  		/*
***************
*** 849,861 ****
  		    (void) Tcl_GetObjResult(interp);
  		}
  		
- 		if (iPtr->tracePtr != NULL) {
- 		    DECACHE_STACK_INFO();
- 		    TclCheckTraces(interp,command,numChars,cmdPtr,result,
- 				   TCL_CMD_TRACE_AFTER,objc,objv);
- 		    CACHE_STACK_INFO();
- 		}
- 		
  		/*
  		 * Pop the objc top stack elements and decrement their ref
  		 * counts. 
--- 859,864 ----
***************
*** 3083,3185 ****
  /*
   *----------------------------------------------------------------------
   *
-  * TclCheckTraces --
-  *
-  *	Checks on all current traces, and invokes procedures which
-  *	have been registered.  This procedure can be used by other
-  *	code which performs execution to unify the tracing system.
-  *	For instance extensions like [incr Tcl] which use their
-  *	own execution technique can make use of Tcl's tracing.
-  *	
-  *	This procedure is used by 'EvalObjv' and 'TclExecuteByteCode'
-  *
-  * Results:
-  *	None.
-  *
-  * Side effects:
-  *	Those side effects made by any trace procedures called.
-  *
-  *----------------------------------------------------------------------
-  */
- void 
- TclCheckTraces(interp, command, numChars, cmdPtr, result, traceFlags, objc, objv)
-     Tcl_Interp *interp;		/* The current interpreter. */
-     char *command;              /* Pointer to beginning of the current 
-                                  * command string. */
-     int numChars;               /* The number of characters in 'command' 
-                                  * which are part of the command string. */
-     Command *cmdPtr;		/* Points to command's Command struct. */
-     int result;                 /* The current result code. */
-     int traceFlags;             /* Current tracing situation. */
-     int objc;			/* Number of arguments for the command. */
-     Tcl_Obj *CONST objv[];	/* Pointers to Tcl_Obj of each argument. */
- {
-     Interp *iPtr = (Interp *) interp;
-     Trace *tracePtr;
-     
-     if (command == NULL) {
- 	return;
-     }
- 
-     for (tracePtr = iPtr->tracePtr;tracePtr != NULL;tracePtr = tracePtr->nextPtr) {
- 	if (tracePtr->level != 0 && iPtr->numLevels > tracePtr->level) {
- 	    continue;
- 	}
- 	if (tracePtr->traceFlags != 0) {
- 	    /* The trace was created with Tcl_CreateTraceObj */
- 	    if (iPtr->numLevels < tracePtr->minLevel) {
- 		continue;
- 	    }
- 
- 	    if (traceFlags & TCL_CMD_TRACE_BEFORE) {
- 		if (tracePtr->cmdPtr != NULL) {
- 		    if (tracePtr->tracingCmdDepth == 0) {
- 			if (cmdPtr == (Command*)tracePtr->cmdPtr) {
- 			    tracePtr->tracingInitialDepth = iPtr->numLevels;
- 			} else {
- 			    continue;
- 			}
- 		    }
- 		    /* If we reach here, we are inside the command
- 		     * we wish to trace. */
- 		    tracePtr->tracingCmdDepth++;
- 		}
- 		if (tracePtr->traceFlags & TCL_CMD_TRACE_BEFORE) {
- 		    (*tracePtr->objProc)(tracePtr->clientData, interp, 
- 		      iPtr->numLevels, tracePtr->tracingInitialDepth, 
- 		      TCL_CMD_TRACE_BEFORE, 0,
- 		      command, numChars, (Tcl_Command)cmdPtr,
- 		      objc, objv);
- 		}
- 	    } else {
- 		if (tracePtr->cmdPtr != NULL) {
- 		    if (tracePtr->tracingCmdDepth == 0) {
- 			continue;
- 		    }
- 		    /* If we reach here, we are inside the command
- 		     * we wish to trace. */
- 		    tracePtr->tracingCmdDepth--;
- 		}
- 		if (tracePtr->traceFlags & TCL_CMD_TRACE_AFTER) {
- 		    (*tracePtr->objProc)(tracePtr->clientData, interp, 
- 			    iPtr->numLevels, tracePtr->tracingInitialDepth,
- 			    tracePtr->traceFlags & TCL_CMD_TRACE_AFTER, 
- 			    result, command, numChars, (Tcl_Command)cmdPtr,
- 			    objc, objv);
- 		}
- 	    }
- 	} else {
- 	    /* The trace was created with Tcl_CreateTrace */
- 	    CallTraceProcedure(interp, tracePtr, cmdPtr,
- 		    command, numChars, objc, objv);
- 	}
-     }
- }
- 
- 
- /*
-  *----------------------------------------------------------------------
-  *
   * CallTraceProcedure --
   *
   *	Invokes a trace procedure registered with an interpreter. These
--- 3086,3091 ----
***************
*** 3206,3212 ****
      int numChars;		/* The number of characters in the
  				 * command's source. */
      register int objc;		/* Number of arguments for the command. */
!     Tcl_Obj *CONST objv[];	/* Pointers to Tcl_Obj of each argument. */
  {
      Interp *iPtr = (Interp *) interp;
      register char **argv;
--- 3112,3118 ----
      int numChars;		/* The number of characters in the
  				 * command's source. */
      register int objc;		/* Number of arguments for the command. */
!     Tcl_Obj *objv[];		/* Pointers to Tcl_Obj of each argument. */
  {
      Interp *iPtr = (Interp *) interp;
      register char **argv;
diff -C 3 -r -X traceignore.txt tcl8.2/generic/tclInt.decls tcl8.2orig/generic/tclInt.decls
*** tcl8.2/generic/tclInt.decls	Wed Sep 22 18:49:37 1999
--- tcl8.2orig/generic/tclInt.decls	Mon Aug 09 20:42:14 1999
***************
*** 543,548 ****
--- 543,549 ----
  declare 145 generic {
      struct AuxDataType *TclGetAuxDataType(char *typeName)
  }
+ 
  declare 146 generic {
      TclHandle TclHandleCreate(VOID *ptr)
  }
***************
*** 590,606 ****
  }
  declare 157 generic {
      Var * TclVarTraceExists (Tcl_Interp *interp, char *varName)
- }
- 
- declare 159 generic {
-     void TclCheckTraces (Tcl_Interp *interp, char *command, int numChars, \
-             Command *cmdPtr, int result, int traceFlags, int objc, \
- 	    Tcl_Obj *CONST objv[])
  }
  
  ##############################################################################
--- 591,596 ----
diff -C 3 -r -X traceignore.txt tcl8.2/generic/tclInt.h tcl8.2orig/generic/tclInt.h
*** tcl8.2/generic/tclInt.h	Sun Sep 19 03:13:53 1999
--- tcl8.2orig/generic/tclInt.h	Mon Aug 02 11:45:37 1999
***************
*** 612,637 ****
   */
  
  typedef struct Trace {
!     int level;			      /* Only trace commands at nesting level
! 				       * less than or equal to this. */
!     union {
!         Tcl_CmdTraceProc *proc;	      /* Procedure to call to trace command. */
! 	Tcl_CmdTraceObjProc *objProc; /* Procedure to call to trace command. */
!     };
!     ClientData clientData;	      /* Arbitrary value to pass to proc. */
!     struct Trace *nextPtr;	      /* Next in list of traces for this 
!     				       * interp. */
!     int traceFlags;		      /* If zero, then this is an old trace 
!     				       * strcture, and the following fields are
!     				       * ignored.  Otherwise it is an or'd 
!     				       * combination of TCL_CMD_TRACE_ flags. 
!     				       * Old trace structures use the 'proc'
!     				       * above, new ones use 'objProc'. */
!     int minLevel;		      /* Only trace commands at nesting level
! 				       * greater than or equal to this. */
!     Tcl_Command cmdPtr;		      /* Only trace inside this command */
!     int tracingCmdDepth;	      /* Used to keep track of depth. */
!     int tracingInitialDepth;	      /* Used to keep track of depth. */
  } Trace;
  
  /*
--- 612,622 ----
   */
  
  typedef struct Trace {
!     int level;			/* Only trace commands at nesting level
! 				 * less than or equal to this. */
!     Tcl_CmdTraceProc *proc;	/* Procedure to call to trace command. */
!     ClientData clientData;	/* Arbitrary value to pass to proc. */
!     struct Trace *nextPtr;	/* Next in list of traces for this interp. */
  } Trace;
  
  /*
***************
*** 1495,1518 ****
  
  typedef struct TclpTime_t_ *TclpTime_t;
  
  /*
   *----------------------------------------------------------------
   * Variables shared among Tcl modules but not used by the outside world.
diff -C 3 -r -X traceignore.txt tcl8.2/generic/tclParse.c tcl8.2orig/generic/tclParse.c
*** tcl8.2/generic/tclParse.c	Wed Sep 22 18:51:37 1999
--- tcl8.2orig/generic/tclParse.c	Thu Aug 12 17:14:42 1999
***************
*** 799,804 ****
--- 799,806 ----
      Interp *iPtr = (Interp *) interp;
      Tcl_Obj **newObjv;
      int i, code;
+     Trace *tracePtr, *nextPtr;
+     char **argv, *commandCopy;
      CallFrame *savedVarFramePtr;	/* Saves old copy of iPtr->varFramePtr
  					 * in case TCL_EVAL_GLOBAL was set. */
  
***************
*** 878,886 ****
       * Call trace procedures if needed.
       */
  
!     if (iPtr->tracePtr != NULL) {
! 	TclCheckTraces(interp, command, length, cmdPtr, TCL_OK,
! 		       TCL_CMD_TRACE_BEFORE, objc, objv);
      }
      
      /*
--- 880,923 ----
       * Call trace procedures if needed.
       */
  
!     argv = NULL;
!     commandCopy = command;
! 
!     for (tracePtr = iPtr->tracePtr; tracePtr != NULL; tracePtr = nextPtr) {
! 	nextPtr = tracePtr->nextPtr;
! 	if (iPtr->numLevels > tracePtr->level) {
! 	    continue;
! 	}
! 
! 	/*
! 	 * This is a bit messy because we have to emulate the old trace
! 	 * interface, which uses strings for everything.
! 	 */
! 
! 	if (argv == NULL) {
! 	    argv = (char **) ckalloc((unsigned) (objc + 1) * sizeof(char *));
! 	    for (i = 0; i < objc; i++) {
! 		argv[i] = Tcl_GetString(objv[i]);
! 	    }
! 	    argv[objc] = 0;
! 
! 	    if (length < 0) {
! 		length = strlen(command);
! 	    } else if ((size_t)length < strlen(command)) {
! 		commandCopy = (char *) ckalloc((unsigned) (length + 1));
! 		strncpy(commandCopy, command, (size_t) length);
! 		commandCopy[length] = 0;
! 	    }
! 	}
! 	(*tracePtr->proc)(tracePtr->clientData, interp, iPtr->numLevels,
! 			  commandCopy, cmdPtr->proc, cmdPtr->clientData,
! 			  objc, argv);
!     }
!     if (argv != NULL) {
! 	ckfree((char *) argv);
!     }
!     if (commandCopy != command) {
! 	ckfree((char *) commandCopy);
      }
      
      /*
***************
*** 909,919 ****
  	(void) Tcl_GetObjResult(interp);
      }
  
-     if (iPtr->tracePtr != NULL) {
- 	TclCheckTraces(interp,command, length, cmdPtr, code,
- 		       TCL_CMD_TRACE_AFTER, objc, objv);
-     }
-     
      done:
      iPtr->numLevels--;
      return code;
--- 946,951 ----
***************
*** 962,972 ****
  	/*
  	 * EvalObjv will increment numLevels so use "<" rather than "<="
  	 */
! 	if ((tracePtr->level == 0 || (iPtr->numLevels < tracePtr->level))
! 	    && !(tracePtr->traceFlags != 0 
! 		 && (iPtr->numLevels < (tracePtr->minLevel - 1)))) {
! 	    /* It's either an old-style trace, or a new-style trace
! 	     * whose level is acceptable. */
  	    int i;
  	    /*
  	     * The command will be needed for an execution trace or stack trace
--- 994,1000 ----
  	/*
  	 * EvalObjv will increment numLevels so use "<" rather than "<="
  	 */
! 	if (iPtr->numLevels < tracePtr->level) {
  	    int i;
  	    /*
  	     * The command will be needed for an execution trace or stack trace