summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdMZ.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2006-04-11 14:37:02 (GMT)
committerdgp <dgp@users.sourceforge.net>2006-04-11 14:37:02 (GMT)
commit4178b8327b6e6dbb1d85866a25606c3417ba68f4 (patch)
tree4741306107e77f7b8f74fe1dc24b9e8ae7648c69 /generic/tclCmdMZ.c
parente5d972dc85e7f1928c032bf9322877cf169bc941 (diff)
downloadtcl-4178b8327b6e6dbb1d85866a25606c3417ba68f4.zip
tcl-4178b8327b6e6dbb1d85866a25606c3417ba68f4.tar.gz
tcl-4178b8327b6e6dbb1d85866a25606c3417ba68f4.tar.bz2
* generic/tclCmdMZ.c: Stop some interference between enter traces
* tests/trace.test: and enterstep traces. [Bug 1458266]
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r--generic/tclCmdMZ.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 9aaa6cb..1613799 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.25 2005/11/18 23:07:27 msofer Exp $
+ * RCS: @(#) $Id: tclCmdMZ.c,v 1.82.2.26 2006/04/11 14:37:04 dgp Exp $
*/
#include "tclInt.h"
@@ -4579,10 +4579,9 @@ TraceExecutionProc(ClientData clientData, Tcl_Interp *interp,
*/
if (call) {
Tcl_SavedResult state;
- int stateCode;
+ int stateCode, i, saveInterpFlags;
Tcl_DString cmd;
Tcl_DString sub;
- int i;
Tcl_DStringInit(&cmd);
Tcl_DStringAppend(&cmd, tcmdPtr->command, (int)tcmdPtr->length);
@@ -4636,8 +4635,9 @@ TraceExecutionProc(ClientData clientData, Tcl_Interp *interp,
Tcl_SaveResult(interp, &state);
stateCode = iPtr->returnCode;
- tcmdPtr->flags |= TCL_TRACE_EXEC_IN_PROGRESS;
+ saveInterpFlags = iPtr->flags;
iPtr->flags |= INTERP_TRACE_IN_PROGRESS;
+ tcmdPtr->flags |= TCL_TRACE_EXEC_IN_PROGRESS;
tcmdPtr->refCount++;
/*
* This line can have quite arbitrary side-effects,
@@ -4646,7 +4646,12 @@ TraceExecutionProc(ClientData clientData, Tcl_Interp *interp,
*/
traceCode = Tcl_Eval(interp, Tcl_DStringValue(&cmd));
tcmdPtr->flags &= ~TCL_TRACE_EXEC_IN_PROGRESS;
- iPtr->flags &= ~INTERP_TRACE_IN_PROGRESS;
+
+ /*
+ * Restore the interp tracing flag to prevent cmd traces
+ * from affecting interp traces
+ */
+ iPtr->flags = saveInterpFlags;;
if (tcmdPtr->flags == 0) {
flags |= TCL_TRACE_DESTROYED;
}