About the current scope location About debug levels

2-86 Oracle Reports Users Guide to Building Reports + Raise Debug.Suspend; + END IF;

2.10.5.1 About creating a debug action

You can create debug actions breakpoints and debug triggers in the PLSQL Interpreter in the following ways: ■ choosing Program Breakpoint or Program Debugging Triggers on the Oracle Reports Builder menu bar while a program unit is open in the PLSQL Interpreter ■ right-clicking in the Source pane of the PLSQL Interpreter and choosing Breakpoint or Debug Trigger ■ inserting debug actions in the Object Navigator pane ■ entering commands in the Interpreter pane When you create a debug action, attach the breakpoint or debug trigger to a program unit source line that is executable. A source line is considered executable if it contains one or more statements for which the PLSQL compiler generates code. For example, source lines containing assignment statements and procedure calls are executable, while source lines containing comments, blank lines, declarations, or the NULL statement are not executable. See also Section 4.14.3, Setting a breakpoint Section 4.14.4, Setting a debug trigger

2.10.6 About the current execution location

The current execution location specifies the next PLSQL source line to be executed. It corresponds to what is commonly referred to as the program counter, or PC. When control passes to the PLSQL Interpreter while running a program for example, when a breakpoint is encountered or following a step operation, the Source pane in the PLSQL Interpreter automatically displays the source line associated with the current execution location. Use the LIST command in the Interpreter pane to manually display the current execution location. For example, entering: .LIST PC will list the current execution location in the Source pane.

2.10.7 About the current scope location

The current scope location dictates where the PLSQL Interpreter looks for local variables and parameters. It corresponds to the current execution location of one of the PLSQL subprograms on the stack. Each time a program units execution is interrupted for example, by a debug action, the scope location is initialized to the execution location of the subprogram at the bottom of the stack. Once execution has been interrupted, you can change the current scope location to another frame on the stack. This enables you to view local variables in another subprogram in the call chain. Advanced Concepts 2-87 See also Section 4.14.14, Displaying the current scope location

2.10.8 About debug levels

When a debug action interrupts program execution, the PLSQL Interpreter takes control and establishes what is known as a debug level. At a debug level, you can enter commands and PLSQL statements to inspect and modify the state of the interrupted program unit as well as resume execution. Since any PLSQL code interactively entered at a debug level may itself be interrupted for example, by encountering another breakpoint, it is possible for debug levels to nest. To facilitate distinguishing one debug level from another, the levels are numbered. The most deeply nested level is assigned the highest number. Numbering starts at zero with the outermost level. The 0th or outermost level is commonly referred to as top level. Top level has no associated program state since it is the outermost level at which program units are originally invoked. When code invoked from top level is interrupted, debug level 1 is established. Similarly, interrupting code invoked from debug level 1 establishes debug level 2, and so on. The PLSQL Interpreter command prompt reflects the current debug level. When the PLSQL Interpreter enters levels below top level, the prompt includes a prefix containing the current debug level number. For example, the PLSQL Interpreter command prompt at debug level 1 appears as: debug 1PLSQL

2.10.9 About modifying code at runtime