TOC PREV NEXT INDEX

 


Remote Debugging Procedures


The debugger_init procedure makes the initial connection with TclPro Debugger:


debugger_init ?host? ?port?

The host is the name of the machine on which TclPro Debugger is running. The host defaults to "localhost." The port is the TCP port that TclPro Debugger uses to communicate with the application. The port defaults to 2576. The debugger_init procedure contacts the debugger instance running on the specified host via the specified port. The debugger_init procedure also automatically instruments any Tcl scripts sourced by the script.

The debugger_init procedure returns 1 if it successfully connects to TclPro Debugger; otherwise it returns 0. You must call debugger_init before calling debugger_eval or debugger_break.


Note: If your embedded application uses multiple subsequent interpreters, that is, it quits and restarts a Tcl interpreter more than once, each main Tcl script is treated as an individual application and must make a new connection with TclPro Debugger.

The debugger_eval procedure instruments Tcl code so TclPro Debugger can control the application while script is evaluated:


debugger_eval ?-name name? ?--? script

You can wrap your whole script inside the debugger_eval block. Any scripts that you source within a debugger_eval block are also instrumented.


Note: The debugger_eval procedure behaves like the eval command if your application is not currently connected to TclPro Debugger.

The optional debugger_eval name switch associates the tag name with the script. This causes TclPro Debugger to store breakpoint information as if the script were sourced from a file named name. This is useful when debugging remote applications or when evaluating blocks of dynamically-generated code that are used multiple times. By creating a unique name for each block, you can set breakpoints in the block that persist across invocations.

The optional switch marks the end of switches. The argument following this one is treated as a script even if it starts with a "".

The debugger_break procedure causes your remote application to break in much the same way as if it had encountered a breakpoint:


debugger_break ?message?

The debugger_break procedure is useful for debugging dynamic code. The only difference between the behavior of debugger_break and a line breakpoint is that debugger_break evaluates the message argument, if it is present, before breaking. When your script encounters a debugger_break procedure, TclPro Debugger displays a dialog box. If the message argument is present and not empty, TclPro Debugger displays the message string in the dialog box.


Note: The debugger_break procedure has no effect if your application is not currently connected to TclPro Debugger.



http://www.ajubasolutions.com
Voice: (650) 210-0100
Fax: (650) 210-0101
support@ajubasolutions.com
TOC PREV NEXT INDEX