Index: TODO =================================================================== diff -u -rac7af6dddd0ab0b13bfd0d1f4b1a829326f045a3 -r79c263a13be8850014d056153956f5a83dfbb639 --- TODO (.../TODO) (revision ac7af6dddd0ab0b13bfd0d1f4b1a829326f045a3) +++ TODO (.../TODO) (revision 79c263a13be8850014d056153956f5a83dfbb639) @@ -1446,11 +1446,24 @@ now it complains about missing cmdPtr; it is not clear, why this is missing at the first place in 8.6b1 while working in 8.5 +- improved library/lib/make.tcl once more +- fixed handling of TclNRRunCallbacks, such that coroutines can be easily + used (more testing required) +- added temporary routine ::nsf::yieldcheck for coro debugging +- renamed Tcl85showStack() to TclShowStack() + + TODO: +- coro cleanup, when really working +- coro regression test + - subcmd * handle sucmd for other method factories * handle absence of -create flag in resolve_method_path (for introspection) +- fix missing cmdPtr in 8.6b1 + "We have no cmdPtr in cscPtr 0x10100e610 ::a.x" + - interfaces in documentation for slots (see for more details ::nx::Class#superclass in nx.tcl). Index: generic/gentclAPI.decls =================================================================== diff -u -r8e08d180ae5161c0ef4410ba3fda6b4de613a391 -r79c263a13be8850014d056153956f5a83dfbb639 --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision 8e08d180ae5161c0ef4410ba3fda6b4de613a391) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision 79c263a13be8850014d056153956f5a83dfbb639) @@ -17,6 +17,8 @@ # # Next Scripting commands # +nsfCmd yieldcheck NsfYiedCheckCmd { +} nsfCmd alias NsfAliasCmd { {-argName "object" -type object} {-argName "-per-object"} Index: generic/nsf.c =================================================================== diff -u -rac7af6dddd0ab0b13bfd0d1f4b1a829326f045a3 -r79c263a13be8850014d056153956f5a83dfbb639 --- generic/nsf.c (.../nsf.c) (revision ac7af6dddd0ab0b13bfd0d1f4b1a829326f045a3) +++ generic/nsf.c (.../nsf.c) (revision 79c263a13be8850014d056153956f5a83dfbb639) @@ -396,8 +396,23 @@ {int i; fprintf(stderr, "\t CALL: %s ", ObjStr(methodObj));for(i=0; iself || cscPtr->frameType != NSF_CSC_TYPE_ACTIVE_FILTER)) { @@ -6659,7 +6676,7 @@ unknown = 1; fprintf(stderr, "+++ %s is protected, therefore maybe unknown %p %s lastself=%p o=%p cd %p flags = %.6x\n", methodName, cmdObj, ObjStr(cmdObj), lastSelf, o, clientData, flags); - /*Tcl85showStack(interp);*/ + /*TclShowStack(interp);*/ } } @@ -10239,7 +10256,7 @@ Tcl_CallFrame *framePtr; Tcl_Namespace *nsPtr; - /*Tcl85showStack(interp);*/ + /*TclShowStack(interp);*/ /* * Find last incovation outside the Next Scripting system namespaces. For @@ -11485,6 +11502,22 @@ * Begin generated Next Scripting commands *******************************************/ /* +nsfCmd yieldcheck NsfYiedCheckCmd { +} +*/ +static int +NsfYiedCheckCmd(Tcl_Interp *interp) { +#if defined(NRE) + Interp *iPtr = (Interp *)interp; + CoroutineData *corPtr = iPtr->execEnvPtr->corPtr; + + TclShowStack(interp); + fprintf(stderr, "stackLevel: %p %d\n", corPtr->stackLevel, *corPtr->stackLevel); +#endif + return TCL_OK; +} + +/* nsfCmd alias NsfAliasCmd { {-argName "object" -type object} {-argName "-per-object"} @@ -12990,7 +13023,7 @@ NsfCallStackContent *cscPtr; int result = TCL_OK; - /*fprintf(stderr, "getSelfObj returns %p\n", object); Tcl85showStack(interp);*/ + /*fprintf(stderr, "getSelfObj returns %p\n", object); TclShowStack(interp);*/ if (selfoption == 0 || selfoption == CurrentoptionObjectIdx) { if (object) { @@ -13439,20 +13472,22 @@ * There is no parameter definition available, get a new one in * the the string representation. */ - /*fprintf(stderr, "calling %s objectparameter\n", objectName(object));*/ Tcl_Obj *methodObj = NsfMethodObj(interp, object, NSF_o_objectparameter_idx); if (methodObj) { + /* fprintf(stderr, "=== calling %s objectparameter\n", objectName(object));*/ result = CallMethod((ClientData) object, interp, methodObj, 2, 0, NSF_CM_NO_PROTECT); if (result == TCL_OK) { rawConfArgs = Tcl_GetObjResult(interp); - /*fprintf(stderr, ".... rawConfArgs for %s => %s\n", objectName(object), ObjStr(rawConfArgs));*/ + /*fprintf(stderr, ".... rawConfArgs for %s => '%s'\n", + objectName(object), ObjStr(rawConfArgs));*/ INCR_REF_COUNT(rawConfArgs); /* Parse the string representation to obtain the internal representation */ - result = ParamDefsParse(interp, methodName, rawConfArgs, NSF_DISALLOWED_ARG_OBJECT_PARAMETER, parsedParamPtr); + result = ParamDefsParse(interp, methodName, rawConfArgs, + NSF_DISALLOWED_ARG_OBJECT_PARAMETER, parsedParamPtr); if (result == TCL_OK) { NsfParsedParam *ppDefPtr = NEW(NsfParsedParam); ppDefPtr->paramDefs = parsedParamPtr->paramDefs; @@ -13467,6 +13502,7 @@ result = TCL_OK; } } + return result; } @@ -13976,7 +14012,7 @@ /*fprintf(stderr, "### setting trace for %s on frame %p\n", fullName, Tcl_Interp_varFramePtr(interp)); - Tcl85showStack(interp);*/ + TclShowStack(interp);*/ result = Tcl_TraceVar(interp, vn, TCL_TRACE_UNSETS, (Tcl_VarTraceProc*)NsfUnsetTrace, (ClientData)objPtr); Index: generic/nsfStack.c =================================================================== diff -u -re2fe47226a0bb0c420173a9590309645e5a0592a -r79c263a13be8850014d056153956f5a83dfbb639 --- generic/nsfStack.c (.../nsfStack.c) (revision e2fe47226a0bb0c420173a9590309645e5a0592a) +++ generic/nsfStack.c (.../nsfStack.c) (revision 79c263a13be8850014d056153956f5a83dfbb639) @@ -2,10 +2,10 @@ static TclVarHashTable *VarHashTableCreate(); static void NsfCleanupObject(NsfObject *object); -void Tcl85showStack(Tcl_Interp *interp) { +void TclShowStack(Tcl_Interp *interp) { Tcl_CallFrame *framePtr; - fprintf(stderr, "Tcl85showStack framePtr %p varFramePtr %p\n", + fprintf(stderr, "TclShowStack framePtr %p varFramePtr %p\n", Tcl_Interp_framePtr(interp), Tcl_Interp_varFramePtr(interp)); /* framePtr = (Tcl_CallFrame *)Tcl_Interp_varFramePtr(interp); for (; framePtr; framePtr = Tcl_CallFrame_callerPtr(framePtr)) { @@ -246,7 +246,7 @@ /*NsfCallStackFindActiveFrame(interp, 0, &activeFramePtr);*/ # if defined(TCL85STACK_TRACE) - Tcl85showStack(interp); + TclShowStack(interp); # endif /* Get the first active non object frame */ framePtr = CallStackGetActiveProcFrame(inFramePtr); @@ -394,7 +394,7 @@ * callframe */ static void CallStackPopAll(Tcl_Interp *interp) { - /*Tcl85showStack(interp);*/ + /*TclShowStack(interp);*/ while (1) { Tcl_CallFrame *framePtr = Tcl_Interp_framePtr(interp); Index: generic/tclAPI.h =================================================================== diff -u -r8e08d180ae5161c0ef4410ba3fda6b4de613a391 -r79c263a13be8850014d056153956f5a83dfbb639 --- generic/tclAPI.h (.../tclAPI.h) (revision 8e08d180ae5161c0ef4410ba3fda6b4de613a391) +++ generic/tclAPI.h (.../tclAPI.h) (revision 79c263a13be8850014d056153956f5a83dfbb639) @@ -180,6 +180,7 @@ static int NsfRelationCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfSetVarCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfSetterCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int NsfYiedCheckCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfOAutonameMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfOCleanupMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfOConfigureMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -261,6 +262,7 @@ static int NsfRelationCmd(Tcl_Interp *interp, NsfObject *object, int relationtype, Tcl_Obj *value); static int NsfSetVarCmd(Tcl_Interp *interp, NsfObject *object, Tcl_Obj *variable, Tcl_Obj *value); static int NsfSetterCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *parameter); +static int NsfYiedCheckCmd(Tcl_Interp *interp); static int NsfOAutonameMethod(Tcl_Interp *interp, NsfObject *obj, int withInstance, int withReset, Tcl_Obj *name); static int NsfOCleanupMethod(Tcl_Interp *interp, NsfObject *obj); static int NsfOConfigureMethod(Tcl_Interp *interp, NsfObject *obj, int objc, Tcl_Obj *CONST objv[]); @@ -343,6 +345,7 @@ NsfRelationCmdIdx, NsfSetVarCmdIdx, NsfSetterCmdIdx, + NsfYiedCheckCmdIdx, NsfOAutonameMethodIdx, NsfOCleanupMethodIdx, NsfOConfigureMethodIdx, @@ -1321,6 +1324,24 @@ } static int +NsfYiedCheckCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + ParseContext pc; + + if (ArgumentParse(interp, objc, objv, NULL, objv[0], + method_definitions[NsfYiedCheckCmdIdx].paramDefs, + method_definitions[NsfYiedCheckCmdIdx].nrParameters, 1, + &pc) != TCL_OK) { + return TCL_ERROR; + } else { + + + ParseContextRelease(&pc); + return NsfYiedCheckCmd(interp); + + } +} + +static int NsfOAutonameMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; NsfObject *obj = (NsfObject *)clientData; @@ -2182,6 +2203,9 @@ {"-per-object", 0, 0, ConvertToString}, {"parameter", 0, 0, ConvertToTclobj}} }, +{"::nsf::yieldcheck", NsfYiedCheckCmdStub, 0, { + } +}, {"::nsf::cmd::Object::autoname", NsfOAutonameMethodStub, 3, { {"-instance", 0, 0, ConvertToString}, {"-reset", 0, 0, ConvertToString},