Contents
Keyword
Index
Using the WDB
GUI
Reference
Information
Troubleshooting
Using
Help |
|
|
The Local Variables view displays the names and values of
variables and parameters local to the current stack frame. These
variables are visible in the Local Variables view when program
execution reaches the declaration of the variable. Each time program
execution is paused, the values displayed in the view are updated and
can then be modified. Global variables are not displayed in the Local
Variables view but can be displayed in the Watch view.
You can display variables in the Local Variables view when
your program is paused. It is useful to observe the value of variables
in a specific function to verify that the function is behaving as
expected.
To view local variables
- In the main window, click the Local Variables tab.
Parameters passed into the current function are listed first,
followed by local variables declared within the current function.
- To expand an expression, click the plus sign (+) to the left of
its name or double-click the line. To collapse an expression, click
the minus sign (-) or double-click the line.
To see the Local Variables view in a separate window
- Click the right mouse button, then click Open Separate View.
The separate window behaves the same as the tabbed Local
Variables view.
- To close the separate window, click the right mouse button, then
click Close.
See Tips for a shortcut to opening a separate
window.
NOTE: When you choose a stack frame from the Call
Stack view, the Local Variables view displays the
variables in that context. You can also view a variable that is not
on the current stack from the Watch view. |
When the program is paused at a breakpoint or between steps, you can
change the value of a numeric or pointer variable. The modified value
replaces the current value in the program. This lets you try changes
and see their results in real time or recover from certain logic
errors.
To change a variable value
- In the Local Variables view, double-click the value you
want to edit. A cursor appears in the Value field.
- Edit the variable's value.
- Press Enter to update the program with the modified
variable value.
See Tips in the Local
Variables View reference topic for keyboard shortcuts.
NOTES:
- Press the Esc key to cancel the edit.
- Character string pointers--You cannot change the
content of the string, but you can change the address value
to point to a string at a different memory address.
- Character arrays -- You can edit the content of a
character array, but there is no safeguard to prevent you
from writing past the allocated array size. Also, the value
must be entered inside double quotes.
|
- The value of a local variable is highlighted in red if it has
changed in the current context since the last break in program
execution.
- Click the
toolbar button to open and close the Local Variables view in
a separate window.
- On the View menu, click Local Variables to
quickly bring the Local Variables view to the top.
- Keyboard shortcuts are available for moving in the Local
Variables view and editing a value. See
Tips in the Local Variables
View reference topic.

Return
to Top |