| off | Index Level | p |
| Syntax | |
| Category | BASIC Debugger |
| Type | Introduction |
| Description |
facilitates the debugging of new FlashBASIC programs and the maintenance of existing FlashBASIC programs.
The FlashBASIC debugger has the following general capabilities: 1) Step through execution of program in single or multiple steps. (see the "e" command). 2) Transfer to a specified line number. (see the "g" command) 3) "Break" execution (temporarily halt) at given line numbers or when specified conditions have been satisfied. (see the "b" command) 4) Display or change any variables, including dimensioned variables. (see the "/" command). 5) "Trace" variables. (see the "t" command) 6) Enter the system debugger. (see the "de" and "debug" commands) 7) Direct output to either terminal or printer. (see the "lp" command) 8) Display and/or pop GOSUB stack. (see the "r" command) 9) Display source code lines. (see the "l" and "c" commands) Note: sys2 privileges are required to use the FlashBASIC debugger. When the FlashBASIC debugger is entered, it indicates the source code line number to be executed next and prompts for commands with an asterisk (*). Symbol Table: When a FlashBASIC program is compiled, a symbol table is generated, unless the "s" (suppress table) option has been used with the "compile" or "basic" verb. The symbol table is stored as part of the object code and is used by the FlashBASIC debugger to reference symbolic variables. If a program calls an external subroutine, and the FlashBASIC debugger has been entered previously, a complete symbol table is set up for the external subroutine. Entering the debugger: There are several ways to enter the debugger. Some of them are voluntary. Among the voluntary methods are: 1) Pressing the "break" key while a FlashBASIC program is executing. 2) Running the program with a "d" option: run bp enter.customer (d)<return> If the program is cataloged, a "d" option may follow the program name at TCL: enter.customer (d)<return> 3) Placing a "debug" statement within the program at the point where the debugger is needed. 4) Running the program with a "e" option, which "breaks" at any "non-fatal" warning message: run bp enter.customer (e)<return> If the program is cataloged, an "e" option may follow the program name at TCL: enter.customer (e)<return> The other ways of entering the debugger are, of course, involuntarily. This occurs if a runtime error is encountered (unless the "a" (abort) option of the "run" verb is selected), or if an "abort" statement is executed in the program. The "*" (asterisk) character is used as the FlashBASIC Debugger prompt character. When it appears in the leftmost column of the terminal display screen, this indicates that the debugger is ready to accept any legal command. The number of "*" characters indicates the current level. "Breakpoints" may be set in the debugger. A "breakpoint" is a conditional expression constructed with a symbol reference (one of the variables from the program), an operator (like "=" or "#"), and a specific value. For instance: item-id#"" sets up a conditional to break into the debugger when the variable "item-id" is non-null. (see the "b" command) Break points set up for a subroutine are independent from break points set up in the main program or other subroutines; however, the execution counters "e" and "n" are global. That is, the break point counters count both main program and subroutine break points in the order they are encountered. The use of multiple symbol tables allows the programmer to set up different break points and/or variable traces for different subroutines. (see the "e" and "n" commands) Operators are used to perform relational comparisons and are used with the "b" command for setting breakpoint conditions. The valid operators are as follows: = equal to. > greater than. < less than. >= greater than or equal to. <= less than or equal to. # not equal to. Referencing variables : once in the debugger, the current value of any variable may be interrogated (and optionally changed) using the following forms: */variable This accesses a plain variable and displays its current value. */dim.array.variable(subscript) This access a single-dimensioned array variable. With the subscript designated, only that element is displayed. */dim.array.variable<return> If a dimensioned array is referenced without a subsrcipt, each element is displayed. Another <break> while in this mode exits this display without stepping through all the elements. */dim.array.variable(n,n) This accesses a specific location of a two-dimensional array. See the above form for array references without subscripts. */* This displays the current assignment of every variable in the program. In each of the above cases (except the "*" form), the operator is given the opportunity to change the requested value. If a <return> is entered at the "=" prompt, the symbol remains unchanged. Otherwise, any value entered is placed into the symbol. Zone output specification : *[{left.limit,right.limit}] -or- *[ The "zone" command sets left and right output zone limits of debugger display. Both "limit" arguments must be numeric, and it is advised that the second argument be larger than the first. The "["command, followed by a <return>, removes zone limits. |
| Options | |
| See Also | r b d e g ABORT k l u run debug t z (R83) basic compile / lp debug DEBUG c{!} de n ? s FlashBASIC Differences down edit return up ?! $! \ error condition non-fatal error condition p # [ help n prompt characters |
| Example | |
| Warnings | |
| Compatibility | D3 7.0 AP R83 AP 6.0 FlashBASIC |
| off | Index Level | p |