TrueGui Help
The TrueGUI Debugger

Glossary Item Box

 

Introduction to the Debugger 

The TrueGUI Interface Debugger is incorporated into the TrueGUI Interface DLL and is always available. The main form may be shown and hidden as desired, either manually or by program commands. Breakpoints may be set to detect regular expression matches in the command stream or explicit Debug.Break() commands may be coded into the program flow. Command flow may be stopped and started manually and the program may be single-stepped on a per-command basis for debugging. Script files may be executed to simulate programmed command sequences. TrueGUI commands may be entered manually and executed in the client application without recoding the application program. Bidirectional message tracing is shown in the trace panel and may be suspended, resumed and cleared both by manual and program commands. 

The debugger can be an extremely helpful learning tool since a client application may be executed on a PC along with the debugger and never be connected to a server. To do this, merely leave out the server address from the client command line in the shortcut and no connection to the server will be attempter by the client. Script files can be used to send a sequence of commands to the client application and the commands and data response messages will be displayed in the debugger trace panel. Manual commands may then be entered creating an easy "What happens if I execute this command?..." scenario. Variables and control states may be inspected from the debugger at any point in the command sequence. Single stepping thru a script file can be used to watch the program flow and the client form changes that result from each command. 

 

The main debugger window is shown below after a series of commands have been executed. 

debug

 

 Running Script Files 

The top control group is used for running TrueGUI script files (see TrueGui Script Files) that will execute a predefined sequence of commands to the client application. Simply type the name of the script file to be run (.tgs extension is the default) and click on the Run button. There are also 4 preprogrammed buttons for running common scripts that you have created and named "Script1.tgs" thru "Script4.tgs". Script files must be stored on the PC in the "\Scripts" subfolder or any other subfolder that you have set up using the TrueGui.ScriptsDirectory property.

 

Controlling Program Flow 

The second control group is used to control the flow of commands into the client application. When in Break mode the command flow is temporarily suspended and the next command to be executed is shown in the read-only window. Clicking on the Step button will cause that single command to be sent on to the client application where it will be executed and any result will be returned to the server. The debugger will hold the command flow in Break mode and the next command to be executed will appear in the text box. Clicking on the Run button will exit Break mode and allow commands to flow as normal from the server (or script file) to the client application for execution.

 

Executing Commands Manually for Debugging 

The third control group is used for entering TrueGUI commands to be sent to the client application for execution. These commands can be sent at any time either in Break mode or while the program is running. Commands entered here must be in .NET native mode with string literals enclosed in double quotes. Commands may be sent to the client in one of two modes: 

1. Command mode sends the command to the client for execution and sends any data response back to the server program just as if the command had been sent by the application program itself. 

2. Query mode sends the command and any data response but does not pass it on to the server. Query mode is useful for getting information about variables and control states without passing that information back to your application program.

 

Debugging commands may be sent between Step commands to affect program flow as desired. 

 

Setting Breakpoints and Forcing a Program Break 

The fourth control group is used to set breakpoints based on command content. Enter any regular expression into the text box and click on the Set button. This will set up a match expression that will be compared against every command before it is sent to the client application. Any match under the rules of regular expression compares will cause the program to enter the Break state with the command shown in the Next Command text box. Clicking on the Run button will cause the program to resume until the next instruction that matches the breakpoint expression is detected. The Step button may also be used at this point to continue thru the program as well as manual debugging commands.

 

Controlling Message Trace and Status Display 

Below the trace panel are three buttons that may be used to manually suspend and resume message tracing as well as one to clear the trace panel. There are also equivalent program commands that accomplish the same purpose: Debug.SuspendTrace(), Debug.ResumeTrace() and Debug.ClearTrace()

At the bottom right is the status display that indicates the Run/Break state of the debugger. 

Closing the debugger form actually just hides it but message tracing is inhibited while it is hidden.

 

Keyboard Shortcuts 

The following keyboard shortcuts are implemented in the debugger: 

F5 - Run

F6 - Break

F8 - Single-Step