Native Inspect Manual (H06.04+)
Using Tcl Scripting
Native Inspect Manual—528122-005
5-2
Pass-Through of Tcl Commands
Pass-Through of Tcl Commands
Some commands, such as set and help, exist in both Native Inspect and Tcl. To use
the Tcl version of such a command, you must “pass through” commands to Tcl by
specifying Tcl on the Native Inspect command line, as follows:
(eInspect 3,301): tcl tcl-command
Native Inspect Commands Implemented in Tcl
Native Inspect contains several commands that are implemented in Tcl. You do not
need to use the Tcl pass-through command when using these Native Inspect
commands:
a command, base command, comment command, d command, disassemble
command, da command, env command, eq command, fn command, i command, jump
command, modify command, reg command, and tn command.
Loading a Tcl Script
To load a Tcl script, use the Tcl source command. For example, to run the script named
myTcl, enter:
(eInspect 3,301): tcl source myTcl
To run the script, enter the name of the Tcl script at the Native Inspect prompt.
Using Variables Defined in a Tcl Script
You can use variables defined in a Tcl script, such as $amount, after you run the Tcl
script that contains the definition.
The Tcl interpreter treats all command arguments as Tcl scripts. The Tcl environment is
persistent for each interactive session, so variables you create and values you set are
retained. For example:
(eInspect 3,301): tcl set x 0xabcd
(eInspect 3,301): tcl puts $x
0xabcd
Programming Native Inspect Tcl Commands
The Tcl Style Guide (http://www.tcl.tk/doc/styleGuide.pdf) provides a structure for Tcl
script headers and the layout of package namespaces. The structure consists of:
•
File header
°
Abstract
°
Copyright notice
°
Revision string
°
Package definition (package name, namespace, version)










