The Variables window lists the local variables in the current stack frame. By default, the Variables window opens automatically whenever you start a debugging session. You can open the Variables window by choosing Window > Debugging > Variables.
If you open the Variables window when a debugging session is running, it closes automatically when you end the debugging session. If you open the window when no debugging session is running, it stays open until you close it.
The information given for each variable includes the variable name and value. You can
click the control to the left of the name to expand or collapse the variable. You can click
the Value cell to edit the value directly in the Variables window.
To display additional information, click the
Change Visible Columns button and
select columns in the Change Visible Columns dialog box.
In some cases, the debugger assigns a pound sign (#) and a number as the variable's value. This number is a unique identifier of the given instance. You can use this identifier to determine if a variable points to the same or to a different instance. You cannot edit this value.
The following table describes the icons displayed to the left of the object name in the Variables window.
Icon | Description |
---|---|
![]() |
Local variable |
![]() |
Local pointer variable |
![]() |
Static local variable |
![]() |
Static local pointer variable |
![]() |
Field |
![]() |
Pointer field |
![]() |
Static field |
![]() |
Static pointer field |
The following table lists the actions you can perform using buttons in the Variables window
Button | Description |
---|---|
![]() |
Shows variables only for the current source code line and the previous source code line |
![]() |
Displays watches in the window. |
![]() |
Opens the New Watch dialog box |
Menu Item | Description |
---|---|
New Watch | Lets you create a new watch |
Delete All | Removes all objects from the Variables window |
Inherited Members | Includes inherited members when debugging a C++ program |
Dynamic Type | Automatically casts C++ variables to dynamic type |
Static Members | Shows static members |
Output Base | Lets you set the outputbase to octal (8), decimal (10), hexadecimal (16), or automatic (pointers in hexadecimal characters, all else in decimal) |
Set Max Object Size | Allows you to increase the default maximum variable value of 4096 bytes |
See Also | |
---|---|
Current Context in the Debugger C and C++ Debugging Tasks: Quick Reference C and C++ Variables and Expressions in the IDE C and C++ Debugger Windows |
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.