Debugging Tools used by a Tcl programmer

Asked By 60 points N/A Posted on -
qa-featured

Dear friends

What are the variable name used in Tcl? List debugging tools used by Tcl Programmer?

Thanks

SHARE
Best Answer by Tender
Best Answer
Best Answer
Answered By 0 points N/A #110247

Debugging Tools used by a Tcl programmer

qa-featured

The variable names that could be used in TCL should start with a letter and then have a mix of numbers and letters and an underscore if necessary (alphanumeric). If you are familiar with older versions of TCL then you may have used :: but in version 8.0 that :: is already restricted.

Some of the debugging tools used by TCL programmers are:

interactive mode – to see where the error was triggered

puts command – gives feedback at the right places within the code. This is what most TCL programmers use

Global variable watch and control – shows the values of global variables

set magic – you can write your own set command because TCL has no reserved words

Minimal stepper – to check what a Tk application is doing in a loop

Static code checking – to read TCL code and try to find out if real or potential problem

Dynamic code checkers – many programmers are dissatisfied with this

Other tools are Tkinspect, TkCon, Guarded Proc, Source Navigator, Nagelfar, RamDebugger

 

Answered By 567090 points N/A #110248

Debugging Tools used by a Tcl programmer

qa-featured

Here are some of the debugging tools that are available to Tcl programmers:

  • puts [info level 0] – this is a small but very useful command when it is placed at the beginning of a procedure.
  • set errorInfo – this is used to view where the error started in interactive mode.
  • info body _the_name_of_the_procedure_ – in interactive mode, if this variable is used it will display the index of the incorrect or faulty line within the procedure body.
  • interp alias {} ? {} set errorInfo – used in interactive mode. This reduces the task of typing the command over and over again into one single question mark.
  • interp alias {} ? {} tkcon error

This is an example of a very minimal switchable debugger:

proc dputs args {puts stderr $args} ;# on
proc dputs args {}                  ;# off (RS)

The learn more about the complete explanation on the other debugging tools.

Login/Register to Answer

Related Questions