{jdebug.tcl

Introduction
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 1998.11.04.

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@aq.org
http://www.aq.org/~js/

Copyright
The library is copyright © 1992-1995 by Jay Sekora, but may be freely redistributed under the conditions at the top of the file.

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'.)
} {{{display:foreground:Red {10.283 11.0}} {jdoc:anchor:anchorname {3.0 4.0 8.0 9.0 15.0 16.0 24.0 25.0 28.0 29.0}} {sel {6.43 6.53}} {jdoc:xref:link {4.53 4.60 4.106 4.113 10.211 10.232 10.240 10.257 10.261 10.282 26.0 26.7 35.20 35.25}} {jdoc:xref:manpage {10.127 10.134 41.185 41.199}} {richtext:font:roman {2.0 3.0 4.0 4.4 4.14 4.53 4.60 4.106 4.113 6.24 6.34 8.0 9.21 10.20 10.30 10.103 10.112 10.127 10.134 10.215 10.222 10.244 10.249 10.261 10.282 10.283 11.0 12.0 13.0 13.88 13.95 13.205 13.222 13.292 13.299 15.0 17.0 18.0 18.9 19.0 19.22 21.0 22.0 24.0 26.7 28.0 30.9 30.10 30.16 31.0 32.0 32.1 32.7 32.50 32.66 33.0 35.0 35.20 35.25 35.101 35.118 35.200 35.217 37.29 37.36 39.24 39.31 39.40 39.46 39.228 39.234 39.249 39.265 41.11 41.17 41.130 41.137 41.185 41.199 42.0}} {richtext:font:italic {30.10 30.16 32.1 32.7 39.40 39.46 39.228 39.234 41.11 41.17}} {richtext:font:bold {4.4 4.14 4.53 4.60 6.24 6.34 10.20 10.30 10.215 10.222 33.0 34.0}} {richtext:font:bolditalic {10.244 10.249 10.261 10.282 35.20 35.25}} {richtext:font:typewriter {4.106 4.113 10.103 10.112 10.127 10.134 13.88 13.95 13.205 13.222 13.292 13.299 18.0 18.9 19.0 19.22 26.0 26.7 30.0 30.9 32.50 32.66 35.101 35.118 35.200 35.217 37.29 37.36 39.24 39.31 39.249 39.265 41.130 41.137 41.185 41.199}} {richtext:font:heading0 {1.0 2.0}} {richtext:font:heading1 {3.0 4.0 8.0 9.0 15.0 16.0 24.0 25.0 28.0 29.0}} {richtext:font:heading2 {9.0 9.21 10.283 11.0 12.0 13.0 16.0 17.0 21.0 22.0 25.0 26.0 29.0 30.0 31.0 32.0 34.0 35.0}} {jdoc:anchorname:Introduction {3.0 4.0}} {jdoc:link:jstools.jdoc {4.53 4.60}} {jdoc:topic:jstools {4.53 4.60}} {jdoc:anchorname:Usage {8.0 9.0}} {jdoc:manpage:tclvars {10.127 10.134}} {jdoc:link:jslibraries.tcl {10.211 10.232}} {jdoc:link:jslibraries.jdoc#Usage {10.240 10.257}} {{} {10.244 10.257 15.0 22.0 23.0 26.0 27.0 28.2 28.7 30.1 30.17 31.0 33.0 35.0}} {jdoc:link:jslibraries.jdoc {10.261 10.282}} {jdoc:anchorname:Credits_and_Copyright {15.0 16.0}} {jdoc:anchorname:Overview {24.0 25.0}} {jdoc:link:#j:debug {4.106 4.113 26.0 26.7}} {jdoc:anchorname:j:debug {28.0 29.0}} {jdoc:link:#Usage {35.20 35.25}} {jdoc:manpage:trace {41.185 41.199}}} {{matchend 41.61} {abbrevstart 42.0} {richptr 4.158} {abbrevend 42.0} {insert 6.53} {matchstart 41.52} {emacs_mark 26.38} {anchor 1.0} {current 17.11}}} {}