Using Breakpoints

You can set breakpoints so that Oracle PL/SQL Debugger breaks program execution at breakpoint locations in the debug process.

Note:

The PL/SQL debugger can only bind breakpoints to a PL/SQL program when the debugging process has started and the PL/SQL program is loaded.

PL/SQL debugging supports these breakpoint activities:

  • Setting breakpoints: When a breakpoint is set, the debugger suspends execution at the specified location in the PL/SQL program.

  • Editing breakpoints information.

  • Setting breakpoints with the hit count property.

Oracle PL/SQL debugging does not support the following types of breakpoint:

  • Function breakpoint.

  • Data breakpoint.

  • Address breakpoint.

  • Breakpoints with conditional properties.

Breakpoint Status

Breakpoint status is indicated by symbols that appear in the gray margin, at the left, in the source window. They are:

  • Enabled: Execution will be suspended at this breakpoint. Breakpoints are only enabled if they can be successfully bound to a PL/SQL program.

  • Disabled: The debugger ignores this breakpoint.

  • Error: No breakpoint can be set at this location; the location is not valid.

  • Warning: No breakpoint can be set because the PL/SQL program has not been loaded yet. The PL/SQL Debugger will bind the breakpoint when the PL/SQL program is loaded.

How Breakpoints Work

To use or set breakpoints, you must make sure that there is a solution opened in the Visual Studio. You cannot set breakpoints if there is no solution open in Visual Studio. When Server Explorer starts or when PL/SQL debugging starts, the solution is created automatically.

Saving and Retrieving Breakpoints

Breakpoint information is saved in a solution. To save breakpoint information, you must open the solution, set breakpoints, and save the solution. When you open the solution, breakpoint information is retrieved from the solution. If you set breakpoints and close the solution without saving, the breakpoint information is gone.

Controlling Breakpoints

You can control breakpoints in the PL/SQL source window in two ways:

  • You can click in the gray area to insert or delete a breakpoint.

  • You can place the cursor where you want the breakpoint, then right-click and select a breakpoint command from the menu. The breakpoint commands vary depending on the context.

Inserting a Breakpoint

To insert a breakpoint, either click in the gray margin next to the area where you want to set the breakpoint, or place the cursor at the desired location in the PL/SQL source window, and select Insert Breakpoint from the menu.

Removing a Breakpoint

To delete a breakpoint, either click on the breakpoint symbol that you want to delete, or right-click the line in the source window that contains the breakpoint, and select Remove Breakpoint from the menu.

Enabling and Disabling Breakpoints

The enable and disable breakpoint commands are toggles.

To enable a disabled breakpoint, either click on the disabled breakpoint symbol that you want to enable, or right-click in the source window that contains the disabled breakpoint, and select Enable Breakpoint from the menu.

The process is the same to disable an enabled breakpoint.

Editing a Breakpoint

To modify a breakpoint, right-click the line that is associated with the breakpoint symbol and select Breakpoint Properties from the menu. When the Breakpoint dialog box appears, you can edit the basic breakpoint properties, such as file name, line and character number.

Note:

Oracle PL/SQL Debugger can only insert a breakpoint at the beginning of the line, and ignores the character field.

Select Hit Count to specify the maximum number of hits that occur before execution breaks.