Examining Debug Information

When you use the Oracle PL/SQL Debugger in break mode, you can examine debugging information through Visual Studio debug windows. This section describes windows used for watching variables in different contexts, and then describes other windows that Oracle PL/SQL debugging uses, and lists non-supported debugging windows.

Watching Variables

This section describes windows used to watch information or evaluate values. Then, information common to all the windows is discussed, such as special compiling requirements and data types supported.

Evaluating Objects, VARRAYs, and Nested Table Types

You must compile objects with debug information in order to be able to evaluate their values in the debugger.

From Server Explorer, expand the User Defined Types node, right-click on the object type node, and select Compile Debug or from the PL/SQL editor displaying the object type specification or body, right-click, and from the menu, select Compile Debug.

Evaluating Package Variables

To evaluate package variables, you must compile the package with debug information.

From Server Explorer, expand the node that contains the program being compiled, right-click on that program, and from the menu, select Compile Debug.

Data Types Not Evaluated

The following data types cannot be evaluated:

Oracle Variable Types

The windows discussed in this section (Watch Window, QuickWatch Dialog Box, Locals Window, and Autos Window) display the name, value, and type of the variables being watched, as follows:

Note: The display format for the values of variables and parameters are based on the NLS settings in the database.

Data Types Supported in the Local, Watch, Quick Watch and Autos Windows

The following table shows the data types supported and their corresponding type and value representations in the Local, Watch, Quick Watch, and Autos Windows. Table 7-1 shows the scalar types.

Table 1 Scalar Type

DATA TYPES TYPE INFORMATION VALUE PRESENTATION
BINARY_INTEGER PLS_INTEGER Numeric string value
BOOLEAN BOOLEAN true, false, or null
BINARY_FLOAT BINARY_FLOAT Numeric string value
BINARY_DOUBLE BINARY_DOUBLE Numeric string value
DEC NUMBER(Precision, Scale) Numeric string value using NLS_NUMERIC_CHARACTERS
DECIMAL NUMBER(Precision, Scale) Numeric string value using NLS_NUMERIC_CHARACTERS
DOUBLE PRECISION NUMBER(Precision, Scale) Numeric string value using NLS_NUMERIC_CHARACTERS
FLOAT FLOAT(Binary precision) Numeric string value using NLS_NUMERIC_CHARACTERS
INT NUMBER(Precision, Scale) Numeric string value using NLS_NUMERIC_CHARACTERS
INTEGER NUMBER(Precision, Scale) Numeric string value using NLS_NUMERIC_CHARACTERS
NATURAL PLS_INTEGER Numeric string value
NATURALN PLS_INTEGER Numeric string value
NUMBER NUMBER(Precision, Scale) Numeric string value using NLS_NUMERIC_CHARACTERS
NUMERIC NUMBER(Precision, Scale) Numeric string value using NLS_NUMERIC_CHARACTERS
PLS_INTEGER PLS_INTEGER Numeric string value
POSITIVE PLS_INTEGER Numeric string value
POSITIVEN PLS_INTEGER Numeric string value
REAL(Float(63)) NUMBER(Precision, Scale) /FLOAT(Binary precision) Numeric string value using NLS_NUMERIC_CHARACTERS
SIGNTYPE PLS_INTEGER Numeric string value
SMALLINT NUMBER(Precision, Scale) Numeric string value using NLS_NUMERIC_CHARACTERS
CHAR CHAR(Length) String value
CHARACTER CHAR(Length) String value
LONG LONG(Max.Length) String value
LONGRAW LONGRAW(Max.Length) String value
MSLABEL MSLABEL(Max.Length) String value
NCHAR NCHAR(Length) String value
NVARCHAR2 NVARCHAR2(Max.Length) String value
RAW RAW(Max.Length) String value
UROWID UROWID String value
ROWID ROWID String value
STRING VARCHAR2(Max.Length) String value
VARCHAR VARCHAR(Max.Length) String value
VARCHAR2 VARCHAR2(Max.Length) String value
DATE DATE String value using NLS_TIMESTAMP_FORMAT
TIMESTAMP TIMESTAMP(Seconds Precision) String value using NLS_TIMESTAMP_FORMAT
TIMESTAMP WITH LOCAL TIME ZONE TIMESTAMP_WITH_LOCAL_TIME_ZONE(Seconds Precision) String value using NLS_TIMESTAMP_FORMAT
TIMESTAMP WITH TIME ZONE TIMESTAMP_WITH_TIME_ZONE(Seconds Precision) String value using NLS_TIMESTAMP_TZ_FORMAT
INTERVAL DAY TO SECOND INTERVAL_DAY_TO_SECOND(Days Precision, Seconds Precision) String value
INTERVAL_YEAR_TO_MONTH INTERVAL YEAR TO MONTH(Years Precision) String value

Table 7-2 shows the composite data types.

Table 2 Composite Data Type

DATA TYPES TYPE INFORMATION VALUE PRESENTATION
OBJECT Object Type name (for example, PERSONTYPE) Object type can be expanded to show attribute values
RECORD Record Type Name Record type can be expanded to show attribute values
ASSOCIATE ARRAY Associate Array Type Name Array type can be expanded to show element values
VARRAY Object Type Name Array type can be expanded to show element values
NESTED TABLE Object Type Name Array type can be expanded to show element values

Table 7-3 shows the LOB types.

Table 3 LOB Type

DATA TYPES TYPE INFORMATION VALUE PRESENTATION
BFILE BFILE The 255 bytes of the value
BLOB BLOB The 255 bytes of the value
CLOB CLOB The 255 characters of the value
NCLOB NCLOB The 255 characters of the value

Evaluating and Modifying PL/SQL Variables and Parameters

In a Watch window, in addition to evaluating a PL/SQL variable, you can also modify the value of the variable. In the following examples, you can view values, and edit the values. When you press Enter the value of the variable changes to the specified value:

Scalar type:

x Number(4,2)

Composite Type:

create type personType as object (
  name varchar2(128),
  age NUMBER(4)
) NOT FINAL;

x persontype;

When you expand x, the debugger displays the attribute information of x.

Package Type:

 CREATE OR REPLACE PACKAGE TESTPACK AS
    PACK1 Number;
    PACK2 NUMBER;
    PROCEDURE TEST;
END TESTPACK;

When you expand TESTPACK, you can see the value of the package variables.

Viewing the Call Stack Window

The Call Stack window displays programs that are in the stack.

You can use the context menu of the Call Stack window to enable or disable call stack properties.

Properties

The Call Stack window supports the following properties:

Property Description
Show Parameter Names The names of the parameters of the PL/SQL program in the current call stack.
Show Parameter Values The values of the parameters of the PL/SQL program in the current call stack. Currently, the Oracle PL/SQL Debugger displays at most 30 characters for the value.
Show Parameter Types The types of the parameters of the PL/SQL program in the current call stack.
Show Line Number The line number in the current call stack.

Viewing the PL/SQL Program Source from the Call Stack Window

To view the PL/SQL program source code on the call stack, do one of the following:

The source window appears and indicates the execution position, at the yellow arrow.

Viewing the Threads Window

The Visual Studio Threads window displays threads running in the PL/SQL debugging process.

Each thread represents a database connection to the Oracle PL/SQL Debugger.

In the Direct Database Debugging mode, you will only see one thread in the Threads window.

In Multitier Application Database or External Application Debugging modes, you will see one or more threads. Each thread represents a PL/SQL program that is being debugged in a database connection created from the application code.

The Threads window displays the following information:

Name Description
ID The current thread ID. This ID uniquely identifies a database connection to the Oracle PL/SQL Debugger.
Name The name of the current thread.
Location The execution location of the current thread.
Priority The priority of the current thread.
Suspend The suspend count of the current thread.

Viewing the Output Window for Debugger Output

The Output window displays the debugger output for the PL/SQL debugging session. To access the Output Window, from the View Menu, select Other Windows, and select Output.The Output window displays debugging information including:

Unsupported Windows

The following Visual Studio debugging windows do not apply to PL/SQL programs and therefore are not supported by Oracle PL/SQL Debugging: