Reference Information · Local Variables View Home and Help Icons Keyword Index Home Using Help
Line Graphic
Line Graphic

Contents

Keyword Index

Using the WDB GUI

Reference Information
Main Window
Menus
Toolbar Icons and Shortcut Keys
Views
Source View
Disassembly View
Command View
Watch View
{short description of image} Local Variables View
Call Stack View
Threads View
Registers View
Memory Usage View
Build View
Dialog Boxes
Load Program Dialog Box
Open File Dialog Box
Save/Restore Debug Session Dialog Box
Breakpoints Dialog Box
Source File Paths Dialog Box
Object File Paths Dialog Box
Signals Dialog Box
Find Dialog Box
Debugger Preferences Dialog Box
Quick Watch Dialog Box
Fix List Dialog Box
Memory Check Dialog Box

Troubleshooting

Using Help



Bullet Overview
Bullet Local Variables View Description
Bullet Pop-up Menu
Bullet Tips
Bullet See Also

Line Graphic

Overview

The Local Variables view displays the names and values of variables and parameters local to the current function. 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.

If you want to monitor a subset of variables, global variables, or variables not in the current stack, use the Watch view instead of the Local Variables view.

In the Local Variables view, you can:

  • Edit the value of all numeric variables, pointers, and static arrays. The modified value replaces the current value in the program.
  • Expand and contract an array, pointer, class, or structure by clicking the plus sign (+) to the left of its name. If expanded, clicking the minus sign (-) collapses the item.
  • Display the local variables in a different context by choosing a stack frame from the Call Stack view.
  • Use keyboard shortcuts to move in the Local Variables view and edit a value. See Tips for keyboard shortcuts.

You can access the Local Variables view from the main WDB GUI window by clicking the Local Variables tab in the lower tabbed area.

Line Graphic

Local Variables View Description

NOTE : You can change the maximum number of string characters or array elements to be displayed in the LocalVariables/Watch/QuickWatch views by using the preference in the Source View section of the Edit > Preferences dialog box. See Setting Debugger Preferences. However, please note that to optimize memory consumption of WDB GUI, it is recommended that you keep this number as small as needed for your debugging session.
Area Description
Name area Displays a list of variables local to the current function. Parameters passed into the current function are listed first, followed by local variables declared within the current function.

Click the plus sign (+) or minus sign (-) to the left of an expression's name to expand or collapse your view of the variable.

Value area Displays the value of a variable in the current function.

The { . . . } symbol indicates that the expression can be expanded. Click the plus sign (+) or minus sign (-) to the left of the expression's name to expand or collapse your view of the variable.

Line Graphic

Pop-up Menu

In the Local Variables view, click the right mouse button to display a pop-up menu that contains the following commands:

Command Action
Quick Watch Displays the value of the selected variable in the Quick Watch dialog box.

Add Watch Adds the selected variable to the Watch view.

Open Separate Window Displays the Local Variables view in a separate window, allowing you to see more than one GUI view at the same time.

Return to Main Window Closes the separate window and enables the Local Variables tab. Available when the Local Variables view is displayed in a separate window.
Line Graphic

Tips

  • 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.
  • To open or close the Local Variables view in a separate window:
    • Click the right mouse button to display a pop-up menu that contains commands to open and close a separate window.
    • Click the Local Variables 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

Moving in the View

You can use the following keys to move in the Local Variables view once a variable is selected. Select a variable by clicking on it.
Shortcut Action
Up Arrow Selects the previous line.
Down Arrow Selects the next line.
Enter Expands/collapses the selected expression, if a plus sign (+) or minus sign (-) appears to the left of the expression's name.
Home Moves to the beginning of the list.
End Moves to the end of the list.
Page Up Moves the list up a page.
Page Down Moves the list down a page.
Left Arrow or
Shift+Tab
Moves the focus to Name field of the line.
Right Arrow or
Tab
Moves the focus to Value field of the line.
Insert If the focus is in the Value field, selects the existing value for editing.

Editing a Variable Value

You can use the following keys to edit a selected value.
Shortcut Action
Esc Cancels the edit.
Enter Updates the program with the modified variable value.
Up Arrow Updates the program with the modified variable value, and moves the focus to the previous line's Value field.
Down Arrow Updates the program with the modified variable value, and moves the focus to the next line's Value field.
Line Graphic

See Also

Line Graphic

Return to Top