This describes the basic internal functions for debugging Insight. This information is for Insight developers trying to debug Insight, not for users trying to debug other programs.
GDBTK_DEBUG - Setting this variable controls the Debug window.
GDBTK_DEBUG may have the following values:
GDBTK_TRACE - This variable determines if tracing is enabled. Tracing may only be enabled at GDBTK startup. Changing GDBTK_TRACE while GDBTK is running has no effect.
GDBTK_TRACE may have the following values:
GDBTK_DEBUGFILE - This variable contains an optional filename where GDBTK will write all debugging information. This information will include the output of all "debug" and "dbug" commands, as well as tracing, if it is enabled. The value of GDBTK_DEBUGFILE will not change what is displayed in the Debug Window, with one exception; when the Debug Window is opened, it will read the contents of GDBTK_DEBUGFILE (if it is set and not "stdout").
GDBTK_DEBUGFILE may have the following values:
All debugging functions have been moved into debug.tcl in the ::debug namespace. "debug" and "dbug" are imported into the global namespace.
The following are the standard debug message functions.
# ----------------------------------------------------------------------------- # NAME: debug::debug # # SYNOPSIS: debug { {msg ""} } # # DESC: Writes a message to the proper output. The priority of the # message is assumed to be "I" (informational). This function # is provided for compatibility with the previous debug function. # For higher priority messages, use dbug. # # ARGS: msg - Message to be displayed. # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- # NAME: debug::dbug # # SYNOPSIS: dbug { level msg } # # DESC: Writes a message to the proper output. Unlike debug, this # function take a priority level. # # ARGS: msg - Message to be displayed. # level - One of the following: # "I" - Informational only # "W" - Warning # "E" - Error # "X" - Fatal Error # ----------------------------------------------------------------------------
These next functions are used to trace variables, which should not be confused with the functions tracing.
# ---------------------------------------------------------------------------- # NAME: debug::trace_var # SYNOPSIS: debug::trace_var {varName mode} # DESC: Sets up variable trace. When the trace is activated, # debugging messages will be displayed. # ARGS: varName - the variable name # mode - one of more of the following letters # r - read # w - write # u - unset # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- # NAME: debug::remove_trace # SYNOPSIS: debug::remove_trace {var mode} # DESC: Removes a trace set up with "trace_var". # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- # NAME: debug::remove_all_traces # SYNOPSIS: debug::remove_all_traces # DESC: Removes all traces set up with "trace_var". # ----------------------------------------------------------------------------
The following two functions may be used to start and stop tracing programmatically.
# ----------------------------------------------------------------------------- # NAME: ::debug::trace_start # SYNOPSIS: ::debug::trace_start # DESC: Starts logging of function trace information. # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- # NAME: ::debug::trace_stop # SYNOPSIS: ::debug::trace_stop # DESC: Stops logging of function trace information. # -----------------------------------------------------------------------------