Komodo User Guide

Debugging Tcl

Use Komodo to debug Tcl programs locally or remotely. See below for instructions on configuring Komodo to debug Tcl programs. For general information about using the Komodo debugger, see Komodo Debugger Functions.

Note: in order to debug Tcl programs, you must have ActiveState's Tcl Dev Kit, available with a membership to ASPN Tcl.

Configuring the Tcl Debugger

You must specify which Tcl interpreter Komodo should use to debug and run Tcl programs.

To specify the Tcl interpreter:

  1. From the Edit menu, select Preferences.
  2. In the Preferences dialog, click Tcl.
    Komodo looks for Tcl interpreters on your system and lists them in this dialog.
  3. If your preferred interpreter is in this list, click to select the interpreter.
    If your preferred interpreter is not in this list, enter the path and file name or click Browse to locate your preferred interpreter.
  4. Click OK.

If no Tcl interpreter is displayed in the list, ensure that the location of the interpreter is specified in your system's PATH variable.

Top

Using the Tcl Remote Debugger

Komodo's Remote Debugger is used to open a program on another machine and debug the program using Komodo. In order to use Komodo's remote debugger, you must first install the Tcl Remote Debugger programs on the remote machine, which call the machine running Komodo. Then you use the Komodo debugger on your local machine to debug your remote program.

Note: in order to remotely debug Tcl programs, you must have ActiveState's Tcl Dev Kit, available with a membership to ASPN Tcl, installed on the remote machine. ASPN Tcl memberships will be available in December 2001.

Installing the Tcl Remote Debugger on the Remote Machine

The Tcl Remote Debugger is a collection of Tcl files that need to be installed on the remote machine. These files were installed in the tcl directory when you installed Komodo. By default, on Windows systems, the tcl directory is located under C:\Program Files\Komodo-x.x\ (where "x.x" is the Komodo version). These files are also available for download from the Komodo Remote Debugging page.

To install the Tcl Remote Debugger:

  • Copy the file tdbg.tcl and the directory engine to a directory on the remote machine. Ensure that the structure is preserved, so that both the file tdbg.tcl and the directory engine are located in the same directory.
Top

Invoking the Tcl Remote Debugger

To debug a Tcl script on a remote machine:

  1. On the local machine, select Listen for Remote Debugger from the Debug menu.
    A Listening for Connection dialog opens and indicates the port number for the process.
  2. Connect to your remote machine and log in.
  3. Run tclsh path/tdbg.tcl, and specify the following options:
  • -file program_name.tcl
  • -port-komodo Remote Debugger Listening Port (by default, port 9000)
  • -host-komodo localhost
  • arguments desired arguments for the script

For example, consider the following scenario:

Remote Machine
  • The file tdbg.tcl and the directory engine are located beneath the directory remote_debug on a Linux machine
  • The Tcl file to be debugged is called test.tcl
Local Machine

In this scenario, you would enter the following command on the remote machine:

tclsh /remote_debug/tdbg.tcl -file test.tcl -port-komodo 9000 -host-komodo mybox

Once the connection is established, you can use the full Komodo debugging functionality, including setting breakpoints, stepping, viewing the call stack, and watching variables. The output from the debug process appears in the Output pane in the Komodo Workspace.

To stop the debugger:

  • From the Debug menu, select Stop
    or
  • Press Shift+F5
Top