02.03.2014 Views

Tornado

Tornado

Tornado

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Tornado</strong> 2.0<br />

User’s Guide<br />

tclerror<br />

Toggles Tcl verbose error printing, to help debug Tcl scripts. When verbose<br />

error mode is ON, the entire stack of error information maintained by the Tcl<br />

interpreter appears when a Tcl error occurs that is not caught. Otherwise,<br />

when verbose error mode is OFF, only the innermost error message is printed.<br />

For example:<br />

(gdb) tcl puts stdout [expr $x+2]<br />

can’t read "x": no such variable<br />

(gdb) tclerror<br />

TCL verbose error reporting is ON.<br />

(gdb) tcl puts stdout [expr $x+2]<br />

can’t read "x": no such variable<br />

while executing<br />

"expr $x..."<br />

invoked from within<br />

"puts stdout [expr $x..."<br />

Tcl also stores the error stack in a global variable, errorInfo. To see the error stack<br />

when Tcl verbose error mode is OFF, examine this variable as follows:<br />

(gdb) tcl $errorInfo<br />

For more information about error handling in Tcl, see B.2.9 Tcl Error Handling,<br />

p.324.<br />

7.6.3 Tcl: Invoking GDB Facilities<br />

You can access GDB facilities from Tcl scripts with the following Tcl extensions:<br />

gdb arguments<br />

Executes a GDB command (the converse of the GDB tcl command). Tcl<br />

evaluates the arguments, performing all applicable substitutions, then<br />

combines them (separated by spaces) into one string, which is passed to GDB’s<br />

internal command interpreter for execution.<br />

If the GDB command produces output, it is shown in the command panel.<br />

If Tcl debugging is enabled (with tcldebug), the following message is printed:<br />

execute: command<br />

If the GDB command causes an error, the Tcl procedure gdb signals a Tcl error,<br />

which causes unwinding if not caught (for information about unwinding, see<br />

B.2.9 Tcl Error Handling, p.324).<br />

268

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!