summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdMZ.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-06-21 17:19:36 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-06-21 17:19:36 (GMT)
commit2e99120257a8ebe71af4bcfeab8cc1d031a4bd24 (patch)
tree0a9a1877392958e625398eecb6274336605a99a9 /generic/tclCmdMZ.c
parenta0b5a0ccd26e0fa70be2e05583c04493b7ecb627 (diff)
downloadtcl-2e99120257a8ebe71af4bcfeab8cc1d031a4bd24.zip
tcl-2e99120257a8ebe71af4bcfeab8cc1d031a4bd24.tar.gz
tcl-2e99120257a8ebe71af4bcfeab8cc1d031a4bd24.tar.bz2
* generic/tclBasic.c: Made the walk of the active trace list aware
* generic/tclCmdMZ.c: of the direction of trace scanning, so the * generic/tclInt.h: proper correction can be made. [Bug 1224585] * tests/trace.test (trace-34.2,3):
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r--generic/tclCmdMZ.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 0c9ff94..1ab108f 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdMZ.c,v 1.82.2.19 2005/05/25 19:25:57 hobbs Exp $
+ * RCS: @(#) $Id: tclCmdMZ.c,v 1.82.2.20 2005/06/21 17:19:42 dgp Exp $
*/
#include "tclInt.h"
@@ -3972,7 +3972,11 @@ Tcl_UntraceCommand(interp, cmdName, flags, proc, clientData)
for (activePtr = iPtr->activeCmdTracePtr; activePtr != NULL;
activePtr = activePtr->nextPtr) {
if (activePtr->nextTracePtr == tracePtr) {
- activePtr->nextTracePtr = tracePtr->nextPtr;
+ if (activePtr->reverseScan) {
+ activePtr->nextTracePtr = prevPtr;
+ } else {
+ activePtr->nextTracePtr = tracePtr->nextPtr;
+ }
}
}
if (prevPtr == NULL) {
@@ -4201,6 +4205,7 @@ TclCheckExecutionTraces(interp, command, numChars, cmdPtr, code,
tracePtr = active.nextTracePtr) {
if (traceFlags & TCL_TRACE_LEAVE_EXEC) {
/* execute the trace command in order of creation for "leave" */
+ active.reverseScan = 1;
active.nextTracePtr = NULL;
tracePtr = cmdPtr->tracePtr;
while (tracePtr->nextPtr != lastTracePtr) {
@@ -4208,6 +4213,7 @@ TclCheckExecutionTraces(interp, command, numChars, cmdPtr, code,
tracePtr = tracePtr->nextPtr;
}
} else {
+ active.reverseScan = 0;
active.nextTracePtr = tracePtr->nextPtr;
}
tcmdPtr = (TraceCommandInfo*)tracePtr->clientData;
@@ -4225,7 +4231,9 @@ TclCheckExecutionTraces(interp, command, numChars, cmdPtr, code,
ckfree((char*)tcmdPtr);
}
}
- lastTracePtr = tracePtr;
+ if (active.nextTracePtr) {
+ lastTracePtr = active.nextTracePtr->nextPtr;
+ }
}
iPtr->activeCmdTracePtr = active.nextPtr;
return(traceCode);
@@ -4296,6 +4304,7 @@ TclCheckInterpTraces(interp, command, numChars, cmdPtr, code,
* Tcl_CreateObjTrace creates one more linked list of traces
* which results in one more reversal of trace invocation.
*/
+ active.reverseScan = 1;
active.nextTracePtr = NULL;
tracePtr = iPtr->tracePtr;
while (tracePtr->nextPtr != lastTracePtr) {
@@ -4303,6 +4312,7 @@ TclCheckInterpTraces(interp, command, numChars, cmdPtr, code,
tracePtr = tracePtr->nextPtr;
}
} else {
+ active.reverseScan = 0;
active.nextTracePtr = tracePtr->nextPtr;
}
if (tracePtr->level > 0 && curLevel > tracePtr->level) {
@@ -4347,7 +4357,9 @@ TclCheckInterpTraces(interp, command, numChars, cmdPtr, code,
tracePtr->flags &= ~TCL_TRACE_EXEC_IN_PROGRESS;
Tcl_Release((ClientData) tracePtr);
}
- lastTracePtr = tracePtr;
+ if (active.nextTracePtr) {
+ lastTracePtr = active.nextTracePtr->nextPtr;
+ }
}
iPtr->activeInterpTracePtr = active.nextPtr;
return(traceCode);