summaryrefslogtreecommitdiffstats
path: root/generic/tclTrace.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2007-07-24 03:05:51 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2007-07-24 03:05:51 (GMT)
commit6abdd3f848d11dc37978bfbfd7025827862dd112 (patch)
tree756cc271c52d04021ba9eaf8b3034d00fbf3d151 /generic/tclTrace.c
parent5785bb0ff0458af7bc55bc79cf0f83bb21cebe7d (diff)
downloadtcl-6abdd3f848d11dc37978bfbfd7025827862dd112.zip
tcl-6abdd3f848d11dc37978bfbfd7025827862dd112.tar.gz
tcl-6abdd3f848d11dc37978bfbfd7025827862dd112.tar.bz2
* generic/tclBasic.c (TEOvI, GetCommandSource):
* generic/tclExecute.c (TEBC, TclGetSrcInfoForCmd): * generic/tclInt.h: * generic/tclTrace.c (TclCheck(Interp|Execution)Traces): Removed the need for TEBC to inspect the command before calling TEOvI, leveraging the TIP 282 infrastructure. Moved the generation of a correct nul-terminated command string away from the trace code, back into TEOvI/GetCommandSource.
Diffstat (limited to 'generic/tclTrace.c')
-rw-r--r--generic/tclTrace.c37
1 files changed, 2 insertions, 35 deletions
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index 638893f..a0c777c 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.41 2007/06/28 21:10:38 patthoyts Exp $
+ * RCS: @(#) $Id: tclTrace.c,v 1.42 2007/07/24 03:05:53 msofer Exp $
*/
#include "tclInt.h"
@@ -1413,24 +1413,11 @@ TclCheckExecutionTraces(
int traceCode = TCL_OK;
TraceCommandInfo* tcmdPtr;
Tcl_InterpState state = NULL;
- Tcl_Obj *commandPtr = NULL;
if (cmdPtr->tracePtr == NULL) {
return traceCode;
}
- /*
- * Insure that we have a nul-terminated command string
- */
-
- if (!command) {
- commandPtr = Tcl_NewListObj(objc, objv);
- command = Tcl_GetStringFromObj(commandPtr, &numChars);
- } else if ((numChars != -1) && (command[numChars] != '\0')) {
- commandPtr = Tcl_NewStringObj(command, numChars);
- command = TclGetString(commandPtr);
- }
-
curLevel = iPtr->varFramePtr->level;
active.nextPtr = iPtr->activeCmdTracePtr;
@@ -1482,9 +1469,6 @@ TclCheckExecutionTraces(
(void) Tcl_RestoreInterpState(interp, state);
}
- if (commandPtr) {
- Tcl_DecrRefCount(commandPtr);
- }
return(traceCode);
}
@@ -1515,8 +1499,7 @@ int
TclCheckInterpTraces(
Tcl_Interp *interp, /* The current interpreter. */
CONST char *command, /* Pointer to beginning of the current command
- * string. If NULL, the string will be
- * generated from (objc,objv) */
+ * string. */
int numChars, /* The number of characters in 'command' which
* are part of the command string. */
Command *cmdPtr, /* Points to command's Command struct. */
@@ -1531,25 +1514,12 @@ TclCheckInterpTraces(
int curLevel;
int traceCode = TCL_OK;
Tcl_InterpState state = NULL;
- Tcl_Obj *commandPtr = NULL;
if ((iPtr->tracePtr == NULL)
|| (iPtr->flags & INTERP_TRACE_IN_PROGRESS)) {
return(traceCode);
}
- /*
- * Insure that we have a nul-terminated command string
- */
-
- if (!command) {
- commandPtr = Tcl_NewListObj(objc, objv);
- command = Tcl_GetStringFromObj(commandPtr, &numChars);
- } else if ((numChars != -1) && (command[numChars] != '\0')) {
- commandPtr = Tcl_NewStringObj(command, numChars);
- command = TclGetString(commandPtr);
- }
-
curLevel = iPtr->numLevels;
active.nextPtr = iPtr->activeInterpTracePtr;
@@ -1648,9 +1618,6 @@ TclCheckInterpTraces(
}
}
- if (commandPtr) {
- Tcl_DecrRefCount(commandPtr);
- }
return(traceCode);
}