2 tdb1.giftdb1.eps

Abstract:

This short reference gives an overview of the commands of tdb, the Tcl-Debugger (Version 3.1 from Juli 7, 1996).

General Information

All commands to the debugger may be entered through the command line interface of tdb. Menus and buttons are simply shortcuts of often used commands.

The Entry Window

The entry window on the bottom of tdb is line-oriented. The line containing the cursor will be given to the Debugger if you press Return. Lines may be reused and modified. Return on an empty line reexecutes the last command. Most of the (simpler) Emacs-commands work as expected as do the editing commands known from Motif.

Command Syntax

Commands to tdb follow this simple syntax:

cmd ?opts? ?args?

cmd is the name of an executable command (like help or info). opts may be options that modify the execution of the command. They are always command-specific and consist of two parts - the option name (eg -win) and an (optional)

args are additional arguments that may be required by the command (eg. ret 3 to return from the 3 topmost stack levels).

Work Environment

run
Load a new program. run progname and run progname.tcl load a new tcl programm with the given arguments into the debugger. If neither name nor arguments are given then the last program is restarted.
exit
Exit the debugger.
entry
Modify the entry point of the programm. The entry point is set to another procedure (default is main). The programm has to be restarted for this option to take effect.
startup
Load a file with initializing code for the programm to debug.
cd
Change into another directory. (both for the debugger and the debugged process).
command
Load, save and create new debugger commands.
script
Load, save and create new script commands.
source
Load a tcl file into the currently debugged process.

Informations about the Programm

info
Informations about the debugged process. info prog gives information about the running programm, info locals about the current local variables, info globals about global variables, info stack about the current call stack, info line about the current line, info procs ?name? about all or a specific procedure and info files about loaded tcl files. (See help info for more details).
show
displays information about the debugger. show break lists all the known breakpoints, show script displays the available scripts.
help
Help - function. Without any argument gives generic help, with a command as argument gives help concerning that command.

Breakpoints in the Programm

There are two types of breakpoints:
SoftBreaks are breakpoint that may be located anywhere in the programm. The debugger finds a softbreak by using a regular expression to match the current line with a list of breakpoints.

HardBreaks are directly set in the programm code (they are tcl commands) and may therefore not be put at every position. They have the advantage to specify a unique position in the programm.

break
Set a breakpoint. break <name> creates a soft breakpoint looking for the expression name, break -hard <name> sets a hard breakpoint
del
Clear one (or all) breakpoints. If a name is given, then just this breakpoint is deleted, otherwise all breakpoints are cleared (or only breakpoints of a given type with the flags -hard- and -soft).

Controlling the Programms

step
Execute the next tcl-Statement. If this is a procedure call then trace into the procedure.
next
Execute the next tcl-command. If this is a procedure, then step over it. Breakpoints within the procedure are honoured though.
cont
Continue until the next breakpoint. With cont -real only hard breakpoints are taken into account.
go
Continue with the programm until a tcl-command matching the argument to the go command is found
ret
Return from a subroutine. With a number as argument return from that many subroutine levels.

Modifying Variables

call
execute a procedure inside of the debugged process (all breakpoints are ignored, execution in real time). May be used to display complex data structures.
get
Show the value of a local variable.
set
Set a local variable to a new value.
getglob
Same as get, but for global variables.
setglob
Same as set, but for global variables.



softWorks
Richard Schwaninger
Sun Jul 21 15:24:37 MET DST 1996