Overview
| Artifact ID: | 7279c649f3fd2d7d3e0fde04306639f42562fa10 |
|---|---|
| Ticket: | 402501ffffffffffffffffffffffffffffffffff
Fix for Bug 119393 ([trace remove] & Tcl_Preserve) |
| User & Date: | dgp on 2001-02-28 06:05:18 |
Changes
- icomment:
Logged In: YES user_id=80530 The fix I had in mind for this has two steps. 1. Modify CallTraces() (in generic/tclVar.c) so that it can recognize a special value #define TCL_TRACE_ERROR_MESSAGE_IN_INTERP_RESULT 0x1 returned from a trace procedure as a signal that the error message should be retrieved from Tcl_GetStringResult(interp). That change would require a TIP. 2. Make use of the new interface by having TraceVarInfo() stick error messages in the interp result and return TCL_TRACE_ERROR_MESSAGE_IN_INTERP_RESULT when there is an error in the evaluation of the trace script. Then get rid of the errMsg field in the TraceVarInfo struct. This seems to me to be the safe way to get an error message that is not a static string back to Tcl_TraceVar(). Similar changes/fixes may also be needed in CallCommandTraces(), etc. This approach may go against the RESTRICTIONS section of Tcl_TraceVar(3), though. That section instructs all trace procedures to save and restore interp->result before returning. But why impose that burden on every trace procedure? Why isn't CallTraces() itself saving and restoring the interpreter result?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"