Troubleshooter Debugger Tab
The Troubleshooter provides a tabbed interface bringing together debugging, tracing and performance metrics to assist you in testing and tuning your Apps.
The Debugger Tab
The Debugger Tab contains the Lianja/VFP Debugger. The tabbed upper container contains an Output panel and the files currently loaded in the Debugger. The lower tabbed container contains the following:
- Command Window
- Breakpoints Grid
- Watches Grid
- Call Stack Grid
- Globals Grid
- Locals Grid
Below these are a message line showing the current operation and an actionbar.
Activating the Debugger
As with all Troubleshooter tabs, the Debugger Tab can be selected by clicking on its tab.
It can also be opened in the following ways:
- Clicking on Debug in the Modebar.
- Automatically, when a running program issues the debugger command.
- Issuing the command debug <filename> or debugger <filename> in the Lianja/VFP Command Window (Console Workspace or Command Window).
Loading Files in the Debugger
Note: if multiple files are loaded, the file in the leftmost tab will be debugged when Run/Continue is clicked.
Called programs are automatically loaded when referenced by a program being debugged and Step Into is clicked.
Right-clicking in a loaded file displays the context menu:
Note: some menu options only operate when the file is in edit mode. See actionbar below for how to switch mode.
While the debugger is active, hovering the mouse over a command, function, field or variable will display its Intellitip with information about its usage, syntax or definition. For more about Intellitips and other Lianja CodeAssistant for Lianja/VFP features, see Script Editor: The Lianja CodeAssistant.
The Output panel displays program and Command Window output.
Right-clicking in the Output panel displays the context menu:
The Debug Console contains a Lianja/VFP Command Window. All Lianja/VFP commands and functions can be used in the Command Window apart from flow control and looping commands and others that form a begin...end statement block.
- The semi-colon ';' line continuation character is not supported.
- & macro substitution is supported.
Output is displayed in the Output panel; errors are reported in the Error Viewer Tab.
Breakpoints cause execution of the running program to pause before the line of code set as a breakpoint is run or when the condition of a conditional breakpoint evaluates to true.
To set a conditional breakpoint, click Add Conditional Breakpoint in the actionbar and enter the condition in the dialog that is displayed.
Line breakpoints can be set and unset using the actionbar or by clicking in the line number column to the left of the selected line.
The Breakpoints grid shows the filename and line number for currently set breakpoints. Double-clicking on a grid row will clear that breakpoint.
Click Remove All Breakpoints in the actionbar to clear all current breakpoints.
Watches (or 'watchpoints') cause execution of the running program to pause after the value of a field or memory variable set as a watchpoint changes. Watches are set using the actionbar:
The Watchpoints grid shows the name, data type and current value for currently set watchpoints. Double-clicking on a grid row will clear that watchpoint.
Click Remove All Watches in the actionbar to clear all current watchpoints.
The Call Stack grid shows the filename and line number for each program in the current stack.
The Globals grid shows the name, type and value of current public variables.
The Locals grid shows the name, type and value of current local and private variables.
|Run/Continue||Run or continue running the program to the next breakpoint or watchpoint or to the end if no breakpoints or watchpoints are set.|
|Edit Code||Put the currently selected file into edit mode.|
|Save Code||Displayed when edit mode (Edit Code above) has been selected. Click to save any changes and exit edit mode.|
|Revert Code||Displayed when edit mode (Edit Code above) has been selected. Click to cancel any changes and exit edit mode.|
|Refresh all files||Refresh all files in the debugger. This will update them with any changes made using the Script Editor in the Apps Workspace or Library Workspace.|
|Step Over||Move to the next line of code without running the current line.|
|Step Into||Run the current line of code then move to the next line.|
|Step Out||Run until returning to the calling program, then move to the next line.|
|Add Conditional Breakpoint||Set a conditional breakpoint on a specified condition. A dialog will be displayed so the condition can be entered.|
|Toggle Breakpoint||Set a breakpoint on the current line, or unset the breakpoint if one already exists.|
|Toggle Watch||Set a watchpoint on the currently selected variable or field, or unset the watchpoint if one already exists.|
|Remove All Breakpoints||Remove all breakpoints.|
|Remove All Watches||Remove all watchpoints.|
|List Status||List the current data environment in the Output window.|
|List Memory||List the current memory variables in the Output window.|
|List Structure||List the structure of the currently selected table or cursor in the Output window.|
|Clear||Clear the Output window.|