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
- assignee changed to: "msofer"
- cmimetype changed to: "text/plain"
- 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 - foundin changed to: "None"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nicolascastagne"
- subsystem changed to: "45. Parsing and Eval"
- title changed to: "retrieve precise line number in case of error"
- type changed to: "RFE"