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.
Figure 1. The
Account application open 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.
Figure 2. Adding a breakpoint
- 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.
Figure 3. Waiting at a breakpoint
- Select 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.
Figure 4. Stepping
into an external function
- 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.
Figure 5. Navigating functions using the Code Structure
view
- 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.
Figure 6. Adding a Watchpoint
- 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.
Figure 7. Command view showing the results of the continue command
- Select . 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.
Figure 8. The Backtrace view
- Select . 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.
Figure 9. The application screen
- 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 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 to close the application screen and return control
back to the Debugger.
- Select to terminate the application and complete the tour.
Terminating the application also terminates the Debugger session.