Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 029c23c57c6b243544e1bb835d7409e850490d5e
Ticket: 1309482fffffffffffffffffffffffffffffffff
retrieve precise line number in case of error
User & Date: nicolascastagne on 2005-09-30 13:22:30
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    When using Tcl embeded in a C/C++ application in order to 
    execute scripts writen by end users, it would be useful to  
    easily display basic debug information to the user in case 
    an error occurs. 
    Among these (and as minima) the error line on which the 
    error occured. 
     
    Today, the errorline registered is not sufficiently precise for 
    a end user.  
     
    Consider the following rather simple example : 
     
     1    if 1 { 
     2        set a 2 
     3        set a 2 3 
     4    } 
     
    The error is on line 3. 
    Now, if we have in the C application : 
     
        result = Tcl_EvalEx(tclInterp, script, length,  
    TCL_EVAL_GLOBAL); 
            if (result != TCL_OK ) { 
               Tcl_Obj *options = Tcl_GetReturnOptions(tclInterp, 
    result); 
               Tcl_Obj *key = Tcl_NewStringObj("-errorline", -1); 
               Tcl_Obj *errorline; 
               Tcl_DictObjGet(NULL, options, key, &errorline); 
               printf(" ERROR line %s\n", Tcl_GetString(errorline)); 
        } 
     
    the output is "ERROR line 1". 
     
    Basically, the error line is not retrieved within the nested 
    script of the "if" command. 
     
    It would be useful to get : 
    - the error line 
    - the name of the procedure 
    whatever the level of 'nesting' is is a script. 
     
    ------ 
    I propose the feature request on the behalf of Don Porter, 
    who asked me to do so on comp.lang.tcl 
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nicolascastagne"
  9. subsystem changed to: "45. Parsing and Eval"
  10. title changed to: "retrieve precise line number in case of error"
  11. type changed to: "RFE"