When using Tcl C++ API Tcl_Eval, if it returns TCL_ERROR, the error message can be retrieved from Tcl_GetStringResult(interp)
. However, when executing a bunch of tcl script, the error message doesn't indicate which line the script fails.
Eg:
can't find package foobar
while executing
"package require foobar"
(file "./test.tn" line 5)
Tcl_GetStringResult(interp)
doesn't provide this information: (file "./test.tn" line 5)
. Is there a way to print out the call stack like in tcl interpreter so that I know which line the script fails?