Programming Tools:prgtools

The menu system of the debugger Foundation

The main menu of the debugger is always visible as the top line of the debugger window. It contains the following menu items:

File

Activates the file menu. This allows navigation within the code window, selects application source code files for display in the code window and terminates the debugger.

Run

Activates the run menu. Run menu options control how the application is run, restart the application and can select another Xbase++ application to debug.

Monitor

Activates the monitor menu. This opens or closes the monitor window for displaying memory variables and the callstack window for displaying the active functions and procedures.

Commands

Activates the command menu. Command menu options control the command window of the debugger and allow breakpoints to be set or deleted.

Options

Activates the options menu. This menu configures the debugger and allows the current configuration to be saved.

Help

Displays a help window.

File menu

The file menu contains options that specify the source code file displayed in the debugger's code window and what section of the source code is visible.

Open module

This option opens a file dialog that lists all the PRG files containing source code. A selection is made in the window using the Return key or by double clicking the highlighted item. The selected PRG file is displayed in the code window of the debugger and breakpoints can be set in this file using the F9 key or Return.

The file names will be displayed with their complete path (full view). The TAB key switches between that view and a file name view (short view). Pressing a letter corresponding to the first letter of a file listed in this view will cause the cursor jump to the next matching file name.

A selection window can also be opened containing a list of all functions, procedures, and methods contained in the PRG file. This selection window is opened by clicking the right mouse button or using the key combination Ctrl+Return after a PRG file is selected.

Goto Line

This option opens an input window that allows specification of a line number for the debugger to display in the code window.

Goto Function

This option displays the source code of any function or procedure in the code window. If the source code for the function is not in the PRG file that is currently displayed in the code window, the debugger opens the appropriate PRG file.

If several functions with the same name exist (STATIC FUNCTIONs) the debugger displays a list of possible files where a function having the specified this name is implemented. The same applies to the Callstack monitor.

To go to a method of a class, enter the classname followed by a colon and the method name, like "MyXbpMLE:init". Additionally, the line number to navigate to can be specified by appending the character '#' and the line number, like "MAIN#567".

Where

This option displays the current program line being executed in the code window. The appropriate PRG file is loaded if it is not already visible. This option performs the same functions as "Open module" and "Goto ..." to reposition the source code on the current line after the code window is scrolled or another window is opened.

Exit

This option terminates the debugger.

Run menu

This menu contains options to control the Xbase++ application. This includes selecting and restarting the application.

Restart

This option terminates and then restarts the current Xbase++ application. All set breakpoints and activated monitors will remain visible after restart.

Startup

The option terminates the current application and opens a window where an application file name can be entered. This allows a different Xbase++ applications to be debugged without terminating and restarting the debugger.

Step

The short-cut key for this option is F8. Either selecting the menu option or pressing F8 executes the next program line in the application source code.

Trace

The short-cut key for this option is F10. Pressing F10 and selecting this menu option both cause all functions and procedures called by the current program line to be completely executed before the debugger pauses program execution on the next line. This skips stepping through the source code of the calling function or procedure.

Go

F5 is the short-cut key for this option. This returns control to the application and turns the debugger off. The debugger can only regain control by being reactivated with the key combination Ctrl+S or if a breakpoint occurs. If Ctrl+S is pressed, the debugger window receives input focus, meaning it must be in the foreground. If the debugger does not display a "green light" after Ctrl+S, the application is in a wait state condition and does not execute any code. In this case the application must receive an event so that it leaves the wait state. The easiest way to accomplish this is to click on the application window with the mouse and if necessary press a key.

Goto Cursor

F7 is the short-cut key for this option. The debugger lets the program code of the application run to the current line in the code window and then interrupts program execution. This menu option and the F7 key set the current line in the code window as a temporary breakpoint.

Step Back

The short-cut key for this option is F4. This option effectively uses the line after the current procedure or function as a break point. When pressed, the current procedure or function runs to completion. The debugger interrupts the program as soon as the current function is terminated. It then positions the code in the code window on the next line of the source code file that called the function or procedure that was active when F4 was pressed.

Monitor menu

This menu includes options to open windows for viewing memory variables and/or the callstack. The information in the windows is automatically updated while the application is running. When the monitor window is active, a variable can be selected with a double click and then edited. The corresponding PRG file is automatically loaded into the code window when any one of the functions or procedures in the callstack window is double clicked with the left mouse button.

Local

Turn the display of variables of the LOCAL storage class on or off.

Static

Turn the display of variables of the STATIC storage class on or off.

Private

Turn the display of variables of the PRIVATE storage class on or off.

Public

Turn the display of variables of the PUBLIC storage class on or off.

Field

Turn the display of variables of the FIELD storage class on or off.

Self

Turn the display of member of the current object on or off. The debugger must be stopped in the context of a method of the object, that means, self must exist. The member variables are ordered by inheritance level, and a consecutive number depicts the levels. The topmost base class will be displayed last.

Callstack

Turn the display of the callstack on or off.

An array displays the callstack's elements. The output is created according to function Var2Char(), without displaying the data types of each element. A code block is shown in its literal representation and objects are showing by class name.

Commands menu

The command window is opened or closed using options in this menu. This window displays the result of all expressions entered on the command line of the debugger. It also records the expression entered and their result. The up arrow key can be used to retrieve a previously entered expression which can be executed again by pressing Return. In addition to managing the command window, the menu also manages breakpoints. A breakpoint designates a line in the source code of the application where the program is automatically interrupted. If a breakpoint is reached while the application is running, the debugger is reactivated and regains control.

Toggle Breakpoint

F9 is the short-cut key for this option. Alternatively, the Return key can be pressed. This option defines the current line in the application source code as a breakpoint or clears a previously defined breakpoint on this line. Whether or not a line is defined as a breakpoint is indicated at the beginning of the source code line in front of the line number.

If a breakpoint shall be toggled at a place of the source code where there is no executable code, as on wrapped lines, for example, the debugger will look within the next 3 lines for executable code and will jump there if possible.

Delete All Breakpoints

This option deletes all of the defined breakpoints in all source code files.

List Breakpoints

This option lists all defined breakpoints in all source code files.

The Return key toggles the breakpoint. The TAB key will leave this dialog and jump to the respective line in the source code.

List Workareas

This option lists all open workareas of the current thread. You can switch to a workarea by hitting the return key.

This changes the current workarea of the debugged program.

List Threads

This option lists all threads of an application and allows for controlling individual threads during a debugging session. Threads can be disabled, which prevents them from executing code while other threads are running. Also, debugging focus can be revoked from threads so that the debugger ignores all break points in threads having no focus. Hence, these threads are no longer monitored by the debugger but continue to run as long as they are not disabled.

Description of the columns
Column Content/Meaning
Is Current thread Marked with * if this is the current thread
Thread Id User-level thread ID equal to ThreadId()
System Handle Thread handle at operating system level
System Thread Id Thread ID at operating system level
State Either RUNNING or SUSPENDED
Can Run Either ENABLED or DISABLED (state cannot be RUNNING)
Is Debugged Either FOCUS (debugger monitors thread) or NOFOCUS (thread is not debugged)

The system thread handle and ID are only of interest when you are dealing with the operating system directly, like when calling the API using DllCall().

Open Command Window

This option opens the command window. Expressions can then be entered on the command line of the debugger. When the command window is already opened, this menu option is replaced with "Close Command Window".

Clear Command Window

This option deletes all the lines previously recorded in the command window.

Options menu

This menu allows several aspects of the debugger to be configured or the current window configuration to be stored. Configuration data is saved in a file with the extension .@@@ and the same file name as the EXE file. If this file exists in the current directory, it is read by the debugger and used for configuration.

Debug Program Startup

If this option is selected, the debugger also displays the program code executed before the call to the Main procedure. This displays the functions AppSys(), DbeSys() and any other INIT PROCEDURE.

Check Time Stamps

This option can be turned on or off. If it is activated, the debugger compares the time stamp of the source code files of the application with the time stamp on the executable files and gives a warning if the executable files (DLL and EXE files) are older than one of the source code files.

Set Tab Width

This option specifies the number of blank spaces that are used to replace tab characters when displaying source code in the code window of the debugger.

Cmds Executed on Startup

If this option is set, all commands entered into the command window will be automatically executed on the next startup using the saved Restart Info.

Inspect ACCESS/ASSIGN

By default, all member variables protected by ACCESS and/or ASSIGN methods can be inspected in the variable monitor. If Inspection of ACCESS/ASSIGN is disabled only those member variables are displayed that are declared with the VAR statement. This means that code is no longer executed to read or write the value of a member variable that is protected by ACCESS and/or ASSIGN. Furthermore, computed member variables are also not displayed in the variable monitore.

When code is executed to read or write member variables this may cause inadvertent changes in the state of the application being debugged. For example, the record pointer may be inadvertently moved.

Save Restart Info

This option saves the current debugger configuration, all current breakpoints and the commands entered into the command window. The file created has the same file name as the application and the extension ".@@@". If XPPDBG -n <EXE-file> is specified on the command line, the debugger ignores the saved information and does not load the @@@ file.

Help menu

This menu contains options that display help information for the debugger.

Short Help

This option opens a small help window that displays the short-cut keys for controlling the debugger.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.