Everything
 

Local Variables panel


This panel displays the contents of local variables and changes their values (see "2.11.5 Displaying and changing local variables").

Note that this panel can only be opened when CS+ is connected with the debug tool.

Caution 1.

During program execution, nothing is displayed on this panel. The contents of each area on this panel are displayed at the time the program has stopped running.

Caution 2.

Because of optimization by a compiler, for blocks where variables, or the subject to be operated on, are not in use, there may be no variable data in the stack and registers. In this case, no variables are displayed that are the subject to be operated on.

Remark

By double-clicking a line delimiting each area on panel, it is possible to change the relevant area to the smallest displayable width without omitting the content in it.

Figure A.12

Local Variables panel

 

This section describes the following.

[How to open]

-

Choose [Local Variable] from the [View] menu.

[Description of each area]

(1)

Scope area

This area selects the scope of local variables to be displayed from the drop-down list.

The selectable items are as follows.

Item

Operation

Current

Displays local variables at scope of the current PC value.

<depth> <Function name() [file name#line number]>Note

Displays local variables at scope of the calling function.

After the program execution, the scope selected here is retained as long as the selected scope exists.

Note

It shows the function caller displayed on Call Stack panel.

(2)

[Name] area

Displays local variable names or function names. Function parameters are also displayed as local variables.

Also, arrays, pointer-type variables, and structures/unions have their hierarchical structure displayed in tree form.

This area cannot be edited.

The meaning of each icon displayed here is as follows.

 

Denotes a variable.

Auto variables, internal static variables, and register variables are also displayed Note.

Arrays, pointer-type variables, and structures/unions have their hierarchical structure displayed in tree form.

If a variable is marked with "+" at the beginning, clicking it expands the next part of the variable (After expansion, the mark changes to "-".).

Array

All elements in the array

Pointer-type variables

Variable at the destination pointed to by the pointer

Note that if the destination pointed to by the pointer is a pointer, it is further assigned a "+" mark. Clicking it shows the other part that is referenced.

However, if the value pointed to by the pointer is unknown, it is marked with "?".

Structure/union

All members of the structure/union

 

Denotes a parameter.

 

Denotes a function.

Note

To display auto variables, be aware that the exact values of local variables cannot be displayed at the prolog of functions ("{" in functions) and epilog of functions ("}" in functions). (The addresses of auto variables are relative addresses from the stack pointer (SP), so that they are indefinite until the SP value is fixed in the function. As the SP is manipulated at the prolog and epilog, its value is indefinite. Therefore, exact values cannot be displayed at the prolog and epilog.)

 

This area has the following features.

(a)

Registration of watch-expressions

C variables can be registered in the Watch panel as watch-expressions.

For details on how to register, See "2.11.6.1 Registering watch-expressions".

Remark

The registered watch-expressions have their scope specification automatically given.

 

(b)

Jump to memory

Selecting [Jump to Memory] from the context menu opens the Memory panel (Memory1) with the caret moved to the address at which a selected local variable is located (If the Memory panel (Memory1) is already open, CS+ jumps to it directly.).

(c)

Zoom in or out on a view

To zoom in and out of the Local Variables panel view, change the zoom ratio by using the drop-down list on the toolbar of the Main window while the focus is placed in the Local Variables panel.

You can also change the zoom ratio by using the [Ctrl] key + mouse-wheel combination.

-

Using the [Ctrl] key + mouse-wheel forward will zoom into the view, making the contents larger and easier to see (max. 300%).

-

Using the [Ctrl] key + mouse-wheel backward will zoom out of the view, making the contents smaller (min. 50%).

 

If the panel is closed after the zoom ratio is changed, the changed zoom ratio is retained (next time, the panel will open at the changed zoom ratio).

(3)

[Value] area

This area displays or changes the values of local variables.

The notation of a data value and encoding of character strings can be selected using the toolbar buttons or from the context menu. Also, it is possible to select a display form where hexadecimal display is always added.

The meaning of marks displayed as values of local variables and their colors are as follows (The colors in which text and backgrounds are displayed depend on how the [General - Font and Color] category of the Option dialog box is set).

Example display (default)

Description

 

Text color

Blue

Local variable values that have been changed by the user. Press [Enter] to write them to the target memory.

Background color

Standard color

 

Text color

Sienna

Local variable values that have been changed due to program execution Note .

Executing the program again will reset the highlighting color.

Background color

LightYellow

?

Text color

Gray

Local variable values that could not be acquired.

Background color

Standard color

Note

Applicable only to cases where the displayed variable names remained same from the program start point to the break point while their values were changed.

 

This area has the following features.

(a)

Alteration of local variable and parameter values

To change a local variable value and parameter value, select the local variable value to be changed first and, after clicking it again, enter directly new values from the keyboard. (Pressing the [Esc] key cancels the edit mode.)

The edited local variable values and parameter values are written into the debug tool's target memory by pressing the [Enter] key or moving the focus to other than the edit area.

For details on how to change local variable and parameter values, see "2.11.5.2 Changing the contents of local variables".

(b)

Saving of local variable values

Choosing [Save Local Variables Data As ...] from the [File] menu opens the Save As dialog box, making it possible to save all content of this panel to a text file (*.txt) or CSV file (*.csv).

For details on how to save local variable values, see "2.11.5.3 Saving the displayed contents of local variables".

(4)

[Type (Byte Size)] area

This area displays the type names of local variables. They are displayed in forms conforming to C language description.

Arrays have the number of their elements added in "[ ]" and functions have their size (in bytes) added in "( )" when they are displayed.

Note that this area cannot be edited.

(5)

[Address] area

This area displays the addresses of local variables. If variables are assigned to registers, the register names are displayed.

This area cannot be edited.

[Toolbar]

Each button in the toolbar are disabled during program execution.

 

Obtains latest information from the debug tool and updates display.

Notation

Shows the following buttons that change the form in which values are displayed.

 

AutoSelect

Displays values on this panel in per-variable predetermined notation (default).

Hexadecimal

Displays values on this panel in hexadecimal.

Decimal

Displays values on this panel in decimal.

Octal

Displays values on this panel in octal.

Binary

Displays values on this panel in binary.

Decimal Notation for Array Index

Displays array indexes on this panel in decimal (default).

Hexadecimal Notation for Array Index

Displays array indexes on this panel in hexadecimal.

Float

Displays values on this panel in Float.

Note that non-4 byte data and data with type information are displayed in default notation.

Double

Displays values on this panel in Double.

Note that non-8 byte data and data with type information are displayed in default notation.

 

Adds the hexadecimal equivalent in bracket "( )” at the end of the value.

Encoding

Shows the following buttons that change the encoding in which string variables are displayed.

 

ASCII

Displays string variables in ASCII code.

Shift_JIS

Displays string variables in Shift_JIS code (default).

EUC-JP

Displays string variables in EUC-JP code.

UTF-8

Displays string variables in UTF-8 code.

UTF-16 Big-Endian

Displays string variables in UTF-16 Big-Endian code.

UTF-16 Little-Endian

Displays string variables in UTF-16 Little-Endian code.

UTF-32 Big-Endian

Displays string variables in UTF-32 Big-Endian code.

UTF-32 Little-Endian

Displays string variables in UTF-32 Little-Endian code.

[[File] menu (Local Variables Panel-Only Items)]

The [File] menu items listed below are provided exclusively on the Local Variables panel (Other menu items are shared with other panels.).

However, all of these items are disabled during program execution.

Save Local Variables Data

Overwrites the last-saved text file (*.txt) or CSV file (*.csv) with the contents of this panel (see "(b) Saving of local variable values").

If you select this item for the first time after the start of the program, the operation will be the same as selecting [Save Local Variables Data As...].

Save Local Variables Data As...

Opens the Save As dialog box in order to save the contents of this panel to a specified text file (*.txt) or CSV file (*.csv) (see "(b) Saving of local variable values").

[[Edit] menu (Local Variables Panel-Only Items)]

The [Edit] menu items listed below are provided exclusively on the Local Variables panel. (All the other menu items are disabled.)

Copy

Copies the content of a selected line or a character string to the clipboard.

Select All

Puts the item into all selected state.

Rename

Goes to edit mode in order to change the value of a selected local variable (see "2.11.5.2 Changing the contents of local variables").

However, this item is disabled during program execution.

Find...

Opens the Find and Replace dialog box, with the [Find in Files] tab selected.

Replace...

Opens the Find and Replace dialog box, with the [Replace in Files] tab selected.

[Context menu]

All the items in the context menu are disabled during program execution.

Register to Watch1

Registers a selected local variable in the Watch panel (Watch1).

Copy

Copies the content of a selected line or a character string to the clipboard.

Notation

Shows the following cascaded menu to specify the form in which values are displayed.

 

AutoSelect

Displays values on this panel in per-variable predetermined notation (default).

Hexadecimal

Displays values on this panel in hexadecimal.

Decimal

Displays values on this panel in decimal.

Octal

Displays values on this panel in octal.

Binary

Displays values on this panel in binary.

Decimal Notation for Array Index

Displays array indexes on this panel is decimal (default).

Hexadecimal Notation for Array Index

Displays array indexes on this panel is hexadecimal.

Float

Displays values on this panel in Float.

Note that non-4 byte data and data with type information are displayed in default notation.

Double

Displays values on this panel in Double.

Note that non-8 byte data and data with type information are displayed in default notation.

Include Hexadecimal Value

Adds the hexadecimal equivalent in bracket "( )” at the end of the value.

Encoding

Shows the following cascaded menu to specify character code.

 

ASCII

Displays string variables in ASCII code.

Shift_JIS

Displays string variables in Shift_JIS code (default).

EUC-JP

Displays string variables in EUC-JP code.

UTF-8

Displays string variables in UTF-8 code.

UTF-16 Big-Endian

Displays string variables in UTF-16 Big-Endian code.

UTF-16 Little-Endian

Displays string variables in UTF-16 Little-Endian code.

UTF-32 Big-Endian

Displays string variables in UTF-32 Big-Endian code.

UTF-32 Little-Endian

Displays string variables in UTF-32 Little-Endian code.

Jump to Memory

Opens the Memory panel (Memory1), with the caret moved to the address indicated by the selected line.