Native Inspect Manual (H06.13+, J06.03+)

5 Using Tcl Scripting
Introduction to Tcl
Native Inspect includes Version 8.5 of the open-source Tool Command Language (Tcl), which
enables you to develop macros that can automate debugging operations. You can write Tcl scripts
made up of built-in Tcl commands, and you can write your own Tcl commands.
Tcl scripts enable you to extend the power and functionality of Native Inspect. Tcl can help you
create custom debugging commands suited for a particular domain or application. For example,
if you are developing a complex application, you could also provide Tcl commands that aid in
debugging the application.
Tcl Version 8.5 is the base scripting engine for Native Inspect. Some new primitives have been
added to facilitate management on the NonStop system.
Learning Tcl
For more information about Tcl, see the following resources:
http://www.tcl.tk/
http://www.tcl.tk/doc/compiler.html
http://www.tcl.tk/scripting/primer.html
http://www.tcl.tk/doc/styleGuide.pdf
Using Native Inspect Tcl Commands
The Tcl command-line interpreter is part of Native Inspect, but Native Inspect commands have
priority over 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 the following 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
Introduction to Tcl 129