Programming Tools:prgtools

Basics of the debugger Foundation

The Xbase++ debugger is started by entering XPPDBG on the command line and runs as an independent process. If the filename of an Xbase++ application is specified as a command line argument, this application is started as another process and debug information about the Xbase++ application can be displayed. For debug information to be available, all of the PRG files of the Xbase++ application must have been compiled using the compiler option /b and the resulting OBJ files linked using the linker option /DE. Otherwise no debug information is available.

The debugger primarily displays debug information about the source code of the application being executed and controlled by the debugger. Any memory variable can be displayed and its contents edited at runtime using the debugger. This is possible whether the variable is declared LOCAL, STATIC, PRIVATE, or PUBLIC. The debugger can also display the callstack, that lists all default user-defined functions, procedures, and methods.

The debugger can interrupt the running application and control the application via breakpoints or using single step mode (this means the source code of the application is processed line by line). Breakpoints automatically interrupt the application and reactivate the debugger. This allows the application to be run step by step to limit and localize the location of an error. The debugger also includes a command line where valid Xbase++ expressions can be executed within the application.

Navigating within the debugger is done using the mouse or short-cut keys. The most important short-cut keys are F8, F5 and the key combination Ctrl+S. F8 executes the next source code line of the application when in single step mode. The F5 key ends the single step mode of the debugger and returns control back to the application until the debugger is reactivated using Ctrl+S (stop application) or a breakpoint is reached. Most other aspects of the debugger are menu driven. The current activity of the debugger is shown by a colored area within the menu bar. Red means the debugger is inactive and the application is running. Green means the debugger is active and controls the application.

If the line of the source code exceeds the width of the source code window, press the space bar to view the complete line.

When the application is active, the application can only be interrupted using the key combination Ctrl+S when program code is being executed in the application. If the application is in a wait state, it is not executing code. This happens during WAIT, Inkey(0), and AppEvent(). As long as the application is waiting for keyboard entry or an event, the debugger cannot intervene in the application since no code is being executed in the application. In this case, the window of the application must be brought into the foreground and a key pressed if necessary so that the application ends the wait state. Only then can the debugger regain control.

The Xbase++ Debugger displays the source code located in the same directory where it has been compiled by default. If the source code cannot be found, the debugger prompts for a search path where source code files can be found. The search path may contain more than one path separated by ';'. The popup dialog has three buttons.

Source code search dialog
Button Description
OK Used to add the entered path to the current search path. This is the default action.
EXIT Ignore entered data.
IGNORE THIS DIALOG Disable the dialog completely. The dialog does not popup again if a file cannot be found.

There are two other options to specify a source path: The commmand line option /s:<path> or the environment variable XPPDBG_SRCPATH.

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.