DataBasic Reference > Nested Programs

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

Reality V15.0 ()

The Debugger (DataBasic debugger) (m618706_.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

The Debugger

This section contains the information required to use the DataBasic Debugger. First it provides brief descriptions of how to enter it, how to use the Symbol Table and how to enable and disable it. The main part of the section contains detailed descriptions of the commands available for using the debugger.

Overview

Entering the Debugger

You can only enter the DataBasic Debugger if your user-id is assigned a security profile that permits it, as described in Enabling and Disabling the Debugger. If permitted, you can enter the debugger as follows:

Once you enter the debugger, the system displays a reason code, the program's item-id and the line number about to be executed, and prompts you with an asterisk (*). The * distinguishes the DataBasic debugger from the system debugger and TCL. For example, the following display appears when you press CTRL+BREAK while the TEST program is executing:

:RUN PROGRAM TEST

I TEST 15
*

This display indicates that the program TEST was interrupted and line 15 was about to be executed when you pressed CTRL+BREAK. The debugger prompts you for input of a debugger command.

The following are the reason codes and their meanings:

Code Reason
A Abort
B Break point
D Debug - command or statement
E Debugger execution - (single step)
I Interrupt (Break)
M Modal - (Call / Enter)
R Return

Note: The line number shown is that in the compiled program; that is, that resulting from combining the source item with any included or chained items. To find out the actual source line number, use the L command.

Nested Programs

If your program has been called from a PERFORM statement, the debugger prompt shows the level of nesting. This can help you keep track of which of a number of different programs or routines you are currently debugging. It is particularly useful when debugging Embedded Basic subroutines.

For example, if a Proc run from TCL runs a DataBasic program that performs the program you are debugging, the nesting level will be 1 and the debugger prompt will appear as follows:

{1}*

Embedded Basic subroutines are always at nesting level 1 or above. For example, if a program called from TCL causes an Embedded Basic subroutine to run, the subroutine will be at nesting level 1. If that subroutine then carries out an action that causes a second Embedded Basic subroutine to run, the second subroutine will be at nesting level 2.

Symbol Table

A symbol table is created by the BASIC command when the program is compiled. The table is appended to the object code item. The symbols can be referenced in the debugger.

Variables

The debugger displays the value of undefined variables as <undefined>, and displays null variables as <null>.

The debugger displays a runtime error message if a variable is referenced before it has been assigned a value. The form of the message depends on whether the variable is a simple variable, a vector entry or an array entry, as follows:

[B10] Program 90740 Line line-no: Unassigned variable variable-name; zero used.

[B10] Program 90740 Line line-no: Unassigned variable vector-name(x,1); zero used.

[B10] Program 90740 Line line-no: Unassigned variable array-name(x,y); zero used.

However, if the symbol table is suppressed, then the message is less explicit:

[B10] Program 90740 Line line-no: Unassigned variable; zero used.

Enabling and Disabling the Debugger

You can deactivate (or activate) the DataBasic Debugger on a port-by-port basis using the SSM command at TCL.

You must be logged on the SYSMAN account to use the SSM command. Briefly, the procedure is as follows:

  1. Enter SSM at TCL. The SECURITY SYSTEM MAINTENANCE menu is displayed.
  2. Enter 3 to display the SECURITY FILE MAINTENANCE menu.
  3. Enter the name of the appropriate security profile (entering * selects the current profile). See Profiles Screens for details.
  4. Select Option 16, Basic Debugger. You are then prompted to enable or disable the debugger. N  disables the Basic debugger and is the default. Y  enables the Basic debugger to allow access to the debugger according to your privilege level and any other restrictions that might apply.
  5. Save your changes.

RealityV15.0Comment on this topic