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.
-
Watch Window
You can evaluate or modify variables or parameters in a PL/SQL program.
You can add a variable to the Watch window in two ways:
-
Double-click an empty row in the Name column of the Watch window, then type the variable name in the selected row and enter.
-
In a PL/SQL program source window, locate the cursor on a PL/SQL variable, then right-click on the PL/SQL program source window and select Add Watch from the menu.
To access the Watch window, select Window from the Debug menu, then select the Watch window.
-
-
QuickWatch Dialog Box
You can quickly evaluate or modify a single variable or parameter of a PL/SQL program using the QuickWatch dialog box.
To access the QuickWatch Window, from the source window, place the cursor on a PL/SQL variable, right-click on the window, and then from the menu, select QuickWatch.
-
Locals Window
You can view local variables or parameters of a PL/SQL program using the Locals windows.
To access the Locals window, select Window from the Debug menu, then select the Locals window.
-
Autos Window
You can view variables used in the current statement and the previous statement using the Autos window.
To access the Autos window, select Window from the Debug menu, then select the Autos window.
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:
-
REF
CURSOR
-
Any predefined, weakly typed
REF
CURSOR
type such asSYS_REFCURSOR
-
REF
object -
CURSOR
-
XMLType
-
ANYTYPE
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:
-
Oracle scalar types:
The type contains the data type name.
-
Composite data types:
The value of the composite data type can be expanded as a tree view.
Composite data type attributes:
The name, value, and type of each attribute/member is included.
-
Oracle package variables:
The package can be expanded as a tree view, and the name, value, and type of each package variable that is included under the package node.
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 7-1 Scalar Type
DATA TYPES | TYPE INFORMATION | VALUE PRESENTATION |
---|---|---|
|
|
Numeric string value |
|
|
|
|
|
Numeric string value |
|
|
Numeric string value |
|
|
Numeric string value using |
|
|
Numeric string value using |
|
|
Numeric string value using |
|
|
Numeric string value using |
|
|
Numeric string value using |
|
|
Numeric string value using |
|
|
Numeric string value |
|
|
Numeric string value |
|
|
Numeric string value using |
|
|
Numeric string value using |
|
|
Numeric string value |
|
|
Numeric string value |
|
|
Numeric string value |
|
|
Numeric string value using |
|
|
Numeric string value |
|
|
Numeric string value using |
|
|
String value |
|
|
String value |
|
|
String value |
|
|
String value |
|
|
String value |
|
|
String value |
|
|
String value |
|
|
String value |
|
|
String value |
|
|
String value |
|
|
String value |
|
|
String value |
|
|
String value |
|
|
String value using |
|
|
String value using |
|
|
String value using |
|
|
String value using |
|
|
String value |
|
|
String value |
Table 7-2 shows the composite data types.
Table 7-2 Composite Data Type
DATA TYPES | TYPE INFORMATION | VALUE PRESENTATION |
---|---|---|
|
Object Type name (for example, |
Object type can be expanded to show attribute values |
|
Record Type Name |
Record type can be expanded to show attribute values |
|
Associate Array Type Name |
Array type can be expanded to show element values |
|
Object Type Name |
Array type can be expanded to show element values |
|
Object Type Name |
Array type can be expanded to show element values |
Table 7-3 shows the LOB types.
Table 7-3 LOB Type
DATA TYPES | TYPE INFORMATION | VALUE PRESENTATION |
---|---|---|
|
|
The 255 bytes of the value |
|
|
The 255 bytes of the value |
|
|
The 255 characters of the value |
|
|
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:
-
Double-click the PL/SQL program name in the Call Stack window.
-
Right-click on the PL/SQL program name in the Call Stack window, and select Switch from the menu.
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:
-
The TCP port number used for PL/SQL debugging.
-
A message that indicates when the database is connected to the debugger.
-
The message that indicates when the database is disconnected from the debugger.
-
When the Oracle PL/SQL Debugger starts or ends.