Index: TODO =================================================================== diff -u -rcdfb4e87948587d1550d49ed943a4aafb33cefb3 -r9b6d912b4fa7ce4cfa982e28b511b9e104985809 --- TODO (.../TODO) (revision cdfb4e87948587d1550d49ed943a4aafb33cefb3) +++ TODO (.../TODO) (revision 9b6d912b4fa7ce4cfa982e28b511b9e104985809) @@ -3179,6 +3179,9 @@ * updated error codes according to git head * factored out mapping of error code to string +- nsf.c: + added cmd __db_compile_epoch for compile-epoch introspection + TODO: - zzz why is the method recompiled for /tmp/sp.tcl ? debug output with VAR_RESOLVER_TRACE Index: generic/nsf.c =================================================================== diff -u -re3487a745ff8d03bff82959c8fb0852e9ae23b36 -r9b6d912b4fa7ce4cfa982e28b511b9e104985809 --- generic/nsf.c (.../nsf.c) (revision e3487a745ff8d03bff82959c8fb0852e9ae23b36) +++ generic/nsf.c (.../nsf.c) (revision 9b6d912b4fa7ce4cfa982e28b511b9e104985809) @@ -7547,9 +7547,15 @@ || (codePtr->nsPtr != nsPtr) || (codePtr->nsEpoch != nsPtr->resolverEpoch)) { -#if defined (VAR_RESOLVER_TRACE) +#if defined(VAR_RESOLVER_TRACE) fprintf(stderr, "ByteCompiled bytecode not valid proc %p cmd %p method %s\n", procPtr, procPtr->cmdPtr, Tcl_GetCommandName(interp, procPtr->cmdPtr)); + fprintf(stderr, " %d %d %d %d\n", + ((Interp *) *codePtr->interpHandle != iPtr), + (codePtr->compileEpoch != iPtr->compileEpoch), + (codePtr->nsPtr != nsPtr), + (codePtr->nsEpoch != nsPtr->resolverEpoch)); + { CompiledLocal *localPtr = procPtr->firstLocalPtr; for (; localPtr != NULL; localPtr = localPtr->nextPtr) { @@ -16571,6 +16577,17 @@ ***********************************************************************/ /* +cmd __db_compile_epoch NsfDebugCompileEpoch {} + */ +static int +NsfDebugCompileEpoch(Tcl_Interp *interp) { + Interp *iPtr = (Interp *) interp; + + Tcl_SetObjResult(interp, Tcl_NewIntObj(iPtr->compileEpoch)); + return TCL_OK; +} + +/* cmd __db_show_stack NsfShowStackCmd {} */ static int Index: generic/nsfAPI.decls =================================================================== diff -u -re3487a745ff8d03bff82959c8fb0852e9ae23b36 -r9b6d912b4fa7ce4cfa982e28b511b9e104985809 --- generic/nsfAPI.decls (.../nsfAPI.decls) (revision e3487a745ff8d03bff82959c8fb0852e9ae23b36) +++ generic/nsfAPI.decls (.../nsfAPI.decls) (revision 9b6d912b4fa7ce4cfa982e28b511b9e104985809) @@ -16,8 +16,9 @@ # # Next Scripting commands # -cmd __db_show_stack NsfShowStackCmd {} +cmd __db_compile_epoch NsfDebugCompileEpoch {} cmd __db_run_assertions NsfDebugRunAssertionsCmd {} +cmd __db_show_stack NsfShowStackCmd {} cmd __profile_clear NsfProfileClearDataStub {} cmd __profile_get NsfProfileGetDataStub {} cmd __unset_unknown_args NsfUnsetUnknownArgsCmd {} Index: generic/nsfAPI.h =================================================================== diff -u -re3487a745ff8d03bff82959c8fb0852e9ae23b36 -r9b6d912b4fa7ce4cfa982e28b511b9e104985809 --- generic/nsfAPI.h (.../nsfAPI.h) (revision e3487a745ff8d03bff82959c8fb0852e9ae23b36) +++ generic/nsfAPI.h (.../nsfAPI.h) (revision 9b6d912b4fa7ce4cfa982e28b511b9e104985809) @@ -235,6 +235,7 @@ static int NsfColonCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfConfigureCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfCurrentCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int NsfDebugCompileEpochStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfDebugRunAssertionsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfFinalizeObjCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfInterpObjCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -330,6 +331,7 @@ static int NsfColonCmd(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); static int NsfConfigureCmd(Tcl_Interp *interp, int configureoption, Tcl_Obj *value); static int NsfCurrentCmd(Tcl_Interp *interp, int currentoption); +static int NsfDebugCompileEpoch(Tcl_Interp *interp); static int NsfDebugRunAssertionsCmd(Tcl_Interp *interp); static int NsfFinalizeObjCmd(Tcl_Interp *interp); static int NsfInterpObjCmd(Tcl_Interp *interp, CONST char *name, int objc, Tcl_Obj *CONST objv[]); @@ -426,6 +428,7 @@ NsfColonCmdIdx, NsfConfigureCmdIdx, NsfCurrentCmdIdx, + NsfDebugCompileEpochIdx, NsfDebugRunAssertionsCmdIdx, NsfFinalizeObjCmdIdx, NsfInterpObjCmdIdx, @@ -1033,6 +1036,22 @@ } static int +NsfDebugCompileEpochStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + (void)clientData; + + + + if (objc != 1) { + return NsfArgumentError(interp, "too many arguments:", + method_definitions[NsfDebugCompileEpochIdx].paramDefs, + NULL, objv[0]); + } + + return NsfDebugCompileEpoch(interp); + +} + +static int NsfDebugRunAssertionsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { (void)clientData; @@ -2426,6 +2445,9 @@ {"::nsf::current", NsfCurrentCmdStub, 1, { {"currentoption", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToCurrentoption, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, +{"::nsf::__db_compile_epoch", NsfDebugCompileEpochStub, 0, { + {NULL, 0, 0, NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} +}, {"::nsf::__db_run_assertions", NsfDebugRunAssertionsCmdStub, 0, { {NULL, 0, 0, NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} },