Purpose: to discuss the tools and techniques for debugging Tcl/Tk/etc. applications making use of Tcl's introspection capabilities.
[I'd love to see pointers to tutorials, white papers, etc. on how to make use of tkinspect, tkcon, etc. for debugging Tcl/Tk applications].
So would I :-)
[tb] 2008-07-30: Debugging with TclTalk
Allthough there is no real debugger in TclTalk, its browser always allows a live view into variables. To halt a script at a certain line, insert the line vwait ::MySemaphore, or what you like to name the variable. Also you could output a string to the transcript saying, that your program is halted. Then you may inspect your variables of interest (or even change them :) using one browser and another one to toggle your semaphore and continue your script.
When debugging a Tk app, then it might be usefull to do a wm withdraw .mywindow, to hide your app and not change the state of it by GUI events, which might occur accidently. Use wm deiconify .mywindow afterwards, to make your application visible again.