02.03.2014 Views

Tornado

Tornado

Tornado

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7<br />

Debugger<br />

(gdb) tclproc mld mload<br />

This command creates a new GDB command, mld. Now, instead of typing tcl<br />

mload, you can run mld as follows:<br />

(gdb) mld vxColor.o priTst.o<br />

You can collect Tcl procedures in a file, and load them into the GDB Tcl interpreter<br />

with this command:<br />

(gdb) tcl source tclFile<br />

If you develop a collection of Tcl procedures that you want to make available<br />

automatically in all your debugging sessions, write them in the file .wind/gdb.tcl<br />

under your home directory. The GDB Tcl interpreter reads this file when it begins<br />

executing. (See 7.7.1 Tcl: Debugger Initialization Files, p.273 for a discussion of how<br />

all the CrossWind and GDB initialization files interact.)<br />

7<br />

7.6.2 Tcl: Specialized GDB Commands<br />

The CrossWind version of GDB includes four commands to help you use Tcl. The<br />

first two were discussed in the previous section. The commands are:<br />

tcl command<br />

Passes the remainder of the command line to the Tcl interpreter, without<br />

attempting to evaluate any of the text as a GDB command.<br />

tclproc gdbName TclName<br />

Creates a GDB command gdbName that corresponds to a Tcl procedure name<br />

TclName. GDB does not evaluate the arguments when gdbName is invoked; it<br />

passes them to the named Tcl procedure just as they were entered.<br />

NOTE: To execute tclproc commands automatically when GDB begins<br />

executing, you can place them in .gdbinit directly (see GDB Initialization Files,<br />

p.253), because tclproc is a GDB command rather than a Tcl command.<br />

However, if you want to keep the tclproc definition together with supporting<br />

Tcl code, you can exploit the gdb Tcl extension described in 7.6.3 Tcl: Invoking<br />

GDB Facilities, p.268 to call gdb tclproc in ~/.wind/gdb.tcl.<br />

tcldebug<br />

Toggles Tcl debugging mode. Helps debug Tcl scripts that use GDB facilities.<br />

When Tcl debugging is ON, all GDB commands or other GDB queries made by<br />

the Tcl interpreter are printed.<br />

267

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

Saved successfully!

Ooh no, something went wrong!