Skip to content
Tcl Source Code History Of Ticket 218408
Login

History Of Ticket 218408

Artifacts Associated With Ticket 218408

  1. Ticket change [f21a4d3109] (rid 109484) by nobody on 2000-10-26 00:57:13:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. 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
      
    4. foundin initialized to: "obsolete: 8.3.1"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "69. Other"
    10. title initialized to: "How to save/restore Tcl interpretor state in C ?"
    11. type initialized to: "RFE"
  2. Ticket change [a282d95251] (rid 109910) by welch on 2000-10-26 08:21:18:

    1. closedate changed to: "2000-10-26T01:21:18"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [1a87582b86] (rid 122992) by dgp on 2001-04-20 02:19:52:

    1. foundin changed to: "None"
    2. status changed to: "Open"
    3. subsystem changed to: "None"
  4. Ticket change [2789d042dd] (rid 88534) by dgp on 2001-04-20 02:20:47:

    1. closedate changed to: "2001-04-19T19:20:47"
    2. closer changed to: "dgp"
    3. status changed to: "Closed"