Explore the Debugger
Follow these steps to explore Debugger features.
- Expand the Intermediate Files folder
in the Accounts node and double-click Account.4gl to
open the source in Code Editor.
- Right-click on line 33, a function call to
AccountForm_ui_uiOpenForm()
and select Add/Delete Breakpoint.A red dot, the breakpoint icon, appears in the gutter adjacent to line 33. - Right-click the Accounts application node and select Debug to
start the application in Debug mode.When the application runs, it stops at the breakpoint, and waits.
- Select Debug > Step in to execute the function call and open the function module,
AccountForm_ui.4gl, in Code Editor.
Execution stops inside the called function, waiting for the next Debugger instruction.
- Use the Code Structure view to quickly locate functions in
AccountForm_ui.4gl for additional breakpoints:
- In the Code Structure view, select the
AccountForm_ui_uiDisplay()
function to display the function source in Code Editor. - In Code Editor, right-click on the line containing the function header and select Add/Delete Breakpoint.
- Repeat Sub-steps a and b to create a breakpoint for
the
AccountForm_ui_uiInput()
function.
- In the Code Structure view, select the
- In the Data view examine the values of local, module and global variables.
- In the Data view, expand the Local variables
folder, right-click on the variable p_openMode, and select
Add to watch.Setting a watchpoint on the p_openMode variable will stop program execution each time the variable value changes.
- In the command line area of the Command view, type
continue to resume program execution until the
p_openMode watchpoint is triggered.Entering the continue command resumes program execution until a breakpoint is reached, a watchpoint is triggered, or the program terminates. The continue command is also available in the Debug menu and Toolbar.
- Select Debug > Continue.An application screen displays and program execution stops at the breakpoint on function AccountForm_ui_uiDisplay().
- Use the Backtrace view to see which functions in the program have been
called.
- Select Debug > Continue.Program execution continues until an interactive Dialog statement (
DISPLAY ARRAY
) switches control to the application screen, which appears exactly as if it were running outside the Debugger. - Interact with the program:
- Select Search in the Accounts window
- Type miller into the User Id
field and select Accept.Control switches back to the Debugger and program execution continues until it reaches the breakpoint at function
AccountForm_ui_uiDisplay()
. - Select Debug > Next to step through the application one instruction at a time until the record for userid miller displays and control is switched back to the application screen.
- Select File > Exit to close the application screen and return control back to the Debugger.
- Select Debug > Continue to terminate the application and complete the tour.
Terminating the application also terminates the Debugger session.