summaryrefslogtreecommitdiffstats
path: root/generic/tclTrace.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-03-10 22:10:37 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-03-10 22:10:37 (GMT)
commita90747f408664f3324867307342bafd1038b4ddc (patch)
treea86fc8f66659e2dd409d346fed4eb1e047ed8c55 /generic/tclTrace.c
parent72ca5496075c88513fe036a43c4bbf94f4c90b42 (diff)
downloadtcl-a90747f408664f3324867307342bafd1038b4ddc.zip
tcl-a90747f408664f3324867307342bafd1038b4ddc.tar.gz
tcl-a90747f408664f3324867307342bafd1038b4ddc.tar.bz2
* generic/tclTrace.c (TclCheckInterpTraces): Corrected mistaken
cast of ClientData to (TraceCommandInfo *) when not warranted. Thanks to Yuri Victorovich for the report. [Bug 1153871] * generic/tcl.h: Moved flag values TCL_TRACE_ENTER_EXEC and * generic/tclInt.h: TCL_TRACE_LEAVE_EXEC from public interface into private. Should be used only by internal workings of execution traces.
Diffstat (limited to 'generic/tclTrace.c')
-rw-r--r--generic/tclTrace.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index 5059a60..f717c8d 100644
--- a/generic/tclTrace.c
+++ b/generic/tclTrace.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclTrace.c,v 1.21 2004/11/15 21:47:23 dgp Exp $
+ * RCS: @(#) $Id: tclTrace.c,v 1.22 2005/03/10 22:10:38 dgp Exp $
*/
#include "tclInt.h"
@@ -62,8 +62,8 @@ typedef struct {
/*
* Used by command execution traces. Note that we assume in the code
- * that the first two defines are exactly 4 times the
- * 'TCL_TRACE_ENTER_EXEC' and 'TCL_TRACE_LEAVE_EXEC' constants.
+ * that TCL_TRACE_ENTER_DURING_EXEC == 4 * TCL_TRACE_ENTER_EXEC and
+ * that TCL_TRACE_LEAVE_DURING_EXEC == 4 * TCL_TRACE_LEAVE_EXEC.
*
* TCL_TRACE_ENTER_DURING_EXEC - Trace each command inside the command
* currently being traced, before execution.
@@ -1462,7 +1462,6 @@ TclCheckInterpTraces(interp, command, numChars, cmdPtr, code,
ActiveInterpTrace active;
int curLevel;
int traceCode = TCL_OK;
- TraceCommandInfo* tcmdPtr;
Tcl_InterpState state = NULL;
if (command == NULL || iPtr->tracePtr == NULL ||
@@ -1516,16 +1515,16 @@ TclCheckInterpTraces(interp, command, numChars, cmdPtr, code,
if (tracePtr->flags & (TCL_TRACE_ENTER_EXEC | TCL_TRACE_LEAVE_EXEC)) {
/* New style trace */
- if ((tracePtr->flags != TCL_TRACE_EXEC_IN_PROGRESS) &&
- ((tracePtr->flags & traceFlags) != 0)) {
- tcmdPtr = (TraceCommandInfo*)tracePtr->clientData;
- tcmdPtr->curFlags = traceFlags;
- tcmdPtr->curCode = code;
- traceCode = (tracePtr->proc)((ClientData)tcmdPtr,
- (Tcl_Interp*)interp,
- curLevel, command,
- (Tcl_Command)cmdPtr,
- objc, objv);
+ if (tracePtr->flags & traceFlags) {
+ if (tracePtr->proc == TraceExecutionProc) {
+ TraceCommandInfo* tcmdPtr =
+ (TraceCommandInfo *) tracePtr->clientData;
+ tcmdPtr->curFlags = traceFlags;
+ tcmdPtr->curCode = code;
+ }
+ traceCode = (tracePtr->proc)(tracePtr->clientData,
+ interp, curLevel, command, (Tcl_Command) cmdPtr,
+ objc, objv);
}
} else {
/* Old-style trace */