Artifacts Associated With Ticket 218408
Ticket change [f21a4d3109] (rid 109484) by nobody on 2000-10-26 00:57:13:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 5369 Bug Version: 8.3.1 SubmitDate: '2000-05-05' LastModified: '2000-05-11' Severity: LOW Status: Closed Submitter: techsupp ChangedBy: hobbs OS: Windows NT FixedDate: '2000-10-25' ClosedDate: '2000-05-11' Name: Christophe Cognault ReproducibleScript: In C code, I want to save interpretor state, do a Tcl_Eval and restore interpretor state, but I don't find any API suitable for my need. In details: I need that because I translate error message in C code by using Tcl_Eval of an 'msgcat::mc' command, but I don't want that this particular Tcl_Eval modify the current interpretor state. Use of Tcl_SaveResult/Tcl_RestoreResult and saving/restoring errorInfo and errorCode are not sufficient because Tcl_Eval modify the flags of current interpretor and I cannot save/restore these flags. And so, in case of error, after translation done, I loose call stack up to C code, e.g.: I have Tcl code that calls a command implemented in C that calls Tcl code with Tcl_Eval. In case of error in the inner Tcl code, I want to get all the call stack in errorInfo, BUT my C code calls Tcl_Eval another time in order to translate an error message and the second Tcl_Eval erases Interp::flags of current interpretor so I loose the call stack in errorInfo, because, on next call to Tcl_AddErrorInfo, errorInfo is cleaned. I think to use 2 interpretor, a main interpretor and a "translator" interpretor but this is not very convenient for my application, so at this moment I implement a kind of Tcl_SaveState/Tcl_RestoreState (but in a very bad way, no stubs, save very few things, bad code...) and I see in tclNamesp.c (1.17) at line 371 in func Tcl_PopCallFrame a comment saying: * What's really needed is a general-purpose mechanism for saving and * restoring interpreter state. So is this mechanism planned or event exist ? DesiredBehavior: Having Tcl_SaveState/Tcl_RestoreState in C API ? The user is likely better off with the two interp model, because there is nothing in the Tcl C API to exactly handle what they need, aside from the Tcl*Result functions. -- 05/11/2000 hobbs - foundin initialized to: "obsolete: 8.3.1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "How to save/restore Tcl interpretor state in C ?"
- type initialized to: "RFE"
Ticket change [a282d95251] (rid 109910) by welch on 2000-10-26 08:21:18:
- closedate changed to: "2000-10-26T01:21:18"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [1a87582b86] (rid 122992) by dgp on 2001-04-20 02:19:52:
- foundin changed to: "None"
- status changed to: "Open"
- subsystem changed to: "None"
Ticket change [2789d042dd] (rid 88534) by dgp on 2001-04-20 02:20:47:
- closedate changed to: "2001-04-19T19:20:47"
- closer changed to: "dgp"
- status changed to: "Closed"