Overview
- Watch your program execute one instruction at a time
- Display the source code for the program that is running
- Highlight the source code line for the instruction that is being executed
- Examine the value of any of your program variables while the program is running
- Examine the value of any system variable while the program is running
- Dynamically set up to 20 breakpoints in your code where the debugger will temporarily stop program execution
- Resume program execution, either one instruction at a time or until the next breakpoint
- Look at the contents of the subroutine stack
- Display window messages
- Debug a program running in any partition on your system, including background partitions (including XAP programs)
- Choose to step through or skip over subroutines
The Comet Debugger is available to those programmers using the Internet Basic Development Platform.
The minimum Comet requirement is Comet2003 Build 321.
Getting Ready to Debug
Starting the Debugger
- Debug Messages -- where status messages are displayed
- Source -- where the source code is displayed
- Watch Variables -- where selected variables are displayed
- Call Stack -- where subroutine labels are displayed
- Window Messages -- where Window messages are displayed
The debugger works by latching onto a program as it is running.
You have the option of attaching to a partition number, session number, or terminal number. These
options are contained on the "Comet" menu.
Alternatively, click the "Debug partition" icon on the tool bar.
Attach to the partition/session/terminal before running the program you want to debug.
When you are finished debugging your program, choose the "Stop Debugging" option. This detaches the
debugger from your program.
Alternatively, click the "Stop debugging" icon on the tool bar.
Debugger Options
- To cause the debugger to stop whenever your program encounters a RUN or ENTER instruction, check the "Begin Program (Run/Enter)" box
- To stop whenever your program encounters an EXIT instruction, check the "Return from Program (Exit)" box
- To stop whenever your program encounters an I/O statement, check the "I/O Statements" box. Note that you program will always stop when it encounters an INPUT or WAIT statement.
- To stop whenever your program encounters a Runtime DOS instruction, check the "RTDOS Calls" box
- To stop whenever your program encounters a handled exception (via EXCP=), check the "Handled Exceptions" box
- To stop whenever your program encounters an unhandled exception, check the "Unhandled Exceptions" box
Source Code Display
Watched Variables
Quick Watch
- Selecting the "Quick Watch" option on the "Debug" menu
- Using the Shift+F9 keyboard accelerator
- Right clicking on a variable name in the "Source" window
The following dialog is displayed:
The dialog shows the selected variable along with its current value, type, length, and precision.
- To display the value in hex, check the "Display as Hex" box
- To recalculate the value, click the "Recalculate" button
- To add this variable to the watch list, click the "Add to Watch" button
Stepping Through Your Program
- Select the "Step Into" option from the "Debug" menu
- Press the F8 or F11 key
- Click the "Step Program" icon on the tool bar
Stepping Into or Over a Subroutine
- Select the "Step Into" option from the "Debug" menu
- Press the F8 or F11 key
- Click the "Step Program" icon on the tool bar
To step over a subroutine, use one of the following methods:
- Select the "Step Over" option from the "Debug" menu
- Press the F10 key
If the debugger is in a subroutine and you want to stop debugging the subroutine (but continue debugging
the rest of the program), use one of the following methods to "step out" of the subroutine:
- Select the "Step Out" option from the "Debug" menu
- Press Shift+F11
- Click the "Step out of function" icon on the tool bar
Setting Breakpoints
- Highlight the source line and press the F9 key
- Double click the source line where you want to insert a breakpoint
The breakpoint is shown as a red oval on the left of the source line.
To start the program executing, use one of the following methods:
- Select the "Go" option on the "Debug" menu
- Press the F5 key
- Click the "Run without tracing" icon on the tool bar
The debugger will then stop the program at the first breakpoint it encounters. (The debugger also
stops at any of the instructions you've chosen in the "Options" setting, including Run/Enter, Exit,
I/O statements, RTDOS calls, handled exceptions, and unhandled exceptions. Also note that the
program stops on its own accord at INPUT and WAIT statements.)
To force the program to stop at any other time, click on the "Stop program" icon on the tool bar.
The window caption line indicates whether the program is running or stopped.
|
|
Program is running
| Program is stopped
|
Editing Breakpoints
- Select the "Remove Breakpoint" option on the "Debug" menu
- Press the F9 key
- Press Alt+F9
- Double click the source line
To remove all breakpoints, use one of the following methods:
- Select the "Clear Breakpoints" option on the "Debug" menu
- Press Ctrl+P
You can also disable a breakpoint, which leaves a breakpoint marker in place but does
not enable the breakpoint for that instruction. To disable a breakpoint, use one of the
following methods:
- Select the "Disable Breakpoint" option on the "Debug" menu
- Press Ctrl+F9
The disabled breakpoint appears as follows:
To edit the entire list of breakpoints, use one of the following methods:
- Select the "Edit Breakpoints" option on the "Debug" menu
- Press Ctrl+B
The following dialog is displayed:
This dialog shows all of the breakpoints and indicates, via a checkbox, whether the
each breakpoint is enabled or disabled. To disable a breakpoint, uncheck the appropriate box. To
enable a breakpoint, check the appropriate box.
This dialog also contains buttons that remove a breakpoint or remove all breakpoints.
Run to Selection
- Select the "Run to Selection" option on the "Debug" menu
- Press Ctrl+F10
Break
- Select "Break" on the "Debug" menu
- Press Shift+F5
Go to IP
- Select "Goto IP" on the "Debug" menu
- Press Alt+F5
Call Stack
Include Files
Window Messages
|