summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorsergey.brester <sergey.brester>2012-02-14 13:06:28 (GMT)
committersergey.brester <sergey.brester>2012-02-14 13:06:28 (GMT)
commit13861f9db31292dca5c7277e0684f0b923a4d681 (patch)
tree503d0d415001110196857a9be3195be45214cb8a /generic/tclExecute.c
parent0ec1610912f5774addb46bc9b819f935c0b247e0 (diff)
downloadtcl-13861f9db31292dca5c7277e0684f0b923a4d681.zip
tcl-13861f9db31292dca5c7277e0684f0b923a4d681.tar.gz
tcl-13861f9db31292dca5c7277e0684f0b923a4d681.tar.bz2
Testing of fixing execution trace, overhead by ensemble commands
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index dc87d70..d2033d0 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -7769,11 +7769,35 @@ TclGetSrcInfoForCmd(
Interp *iPtr,
int *lenPtr)
{
+ int len;
+ ByteCode *codePtr;
+
CmdFrame *cfPtr = iPtr->cmdFramePtr;
- ByteCode *codePtr = (ByteCode *) cfPtr->data.tebc.codePtr;
+ const char * command;
+
+ if (!cfPtr)
+ return NULL;
+ codePtr = (ByteCode *) cfPtr->data.tebc.codePtr;
+ if (!codePtr)
+ return NULL;
+ if (!cfPtr->data.tebc.pc)
+ return NULL;
+
+ command = GetSrcInfoForPc((unsigned char *) cfPtr->data.tebc.pc,
+ codePtr, &len);
+
+ // [sebres] if ensemble call - shift string ptr to subcommand (string range -> range) :
+ if (command && len && (lenPtr && *lenPtr == -2) && codePtr->objArrayPtr) {
+ Tcl_Obj * objPtr = codePtr->objArrayPtr[0];
+ if (len > objPtr->length) {
+ command += objPtr->length + 1;
+ len -= objPtr->length + 1;
+ }
+ }
- return GetSrcInfoForPc((unsigned char *) cfPtr->data.tebc.pc,
- codePtr, lenPtr);
+ if (lenPtr != NULL)
+ *lenPtr = len;
+ return command;
}
void