The jdebug.tcl library is distributed as part of the jstools package. It consists of a single procedure, j:debug, useful for debugging Tk¡based applications.
This document describes jdebug.tcl version 3.6/3.0.
Usage
Accessing the Library
In order to use the jdebug.tcl library, it (and any other libraries it depends on) must be in your Tcl auto_path, described in tclvars(n). Information about how to arrange that, and other conventions common to the jstools libraries, is in the Usage section of The jstools Libraries.
The JSTOOLS_DEBUGGING Environment Variable
So as to interfere as little as possible with normal use of applications which call it, j:debug is defined as a null procedure under normal circumstances. In order to actually use it, you need to set the JSTOOLS_DEBUGGING environment variable before starting an application which auto¡loads j:debug.
Credits and Copyright
Author
Jay Sekora
js@bu.edu
http://shore.net/~js/
Copyright
The library is copyright ⌐ 1992-1994 by Jay Sekora, but may be freely copied and modified for non¡commercial purposes. (Please contact me if you want to use it for a commercial purpose, this may be OK under some circumstances.)
Overview
Procedure
j:debug - record debugging information
j:debug
Usage
j:debug [string]
Argument
string is information to display; it defaults to {j:debug called}.
Description
As described in the Usage section above, this procedure does nothing unless the environment variable JSTOOLS_DEBUGGING is defined when it is auto¡loaded. (Essentially, this means that you should set JSTOOLS_DEBUGGING before starting an application that you want to debug.) This description assumes that is the case.
The first time it is called, j:debug creates a new toplevel window with a text widget, to display the debugging log, and a scrollbar.
Each time it is called, j:debug inserts string along with some additional information at the end of the debugging log. The exact format of the information appended to the log is subject to change, but currently it includes the string specified (or {j:debug called}), the name of the current procedure, and the names of up to two calling procedures higher on the procedure stack.
Typically, string might include the values of local variables you want to monitor. (You could even arrange to automatically call j:debug whenever the value of a variable changes with `trace variable'.)
Evolution
Feel free to report bugs (and feature requests) to me, <js@bu.edu>, and I will try to deal with them. Also, feel free to fix bugs or add features on your own and let me know how you did it.
Changes
* The jdebug.tcl library is new in version 3.6/3.0.