debugger.Watch.GetValue


This function refers to a variable value.

[Specification format]

debugger.Watch.GetValue(variableName, encode = Encoding.Default, watchOption = WatchOption.Auto)

[Argument(s)]

Argument

Description

variableName

Specify the variable name, register name, or I/O register name/SFR register name to reference.

encode

Specify the encoding to use when displaying strings.

By default, the system encoding is used.

The encoding name conforms to the .NET specifications.

Examples: Encoding.utf-8, Encoding.euc-jp

watchOption

Specify an option.

The options that can be specified are shown below.

Type

Description

WatchOption.Auto

Automatically detect when displaying (default).

WatchOption.Binary

Display in binary format.

WatchOption.Octal

Display in octal format.

WatchOption.Decimal

Display in decimal format.

WatchOption.SignedDecimal

Display in signed decimal format.

WatchOption.UnsignedDecimal

Display in unsigned decimal format.

WatchOption.Hexdecimal

Display in hexadecimal format.

WatchOption.String

Display as a string.

WatchOption.Sizeof

Display the variable size in decimal format.

WatchOption.Float

Display in float type.

WatchOption.Double

Display in double type.

[Return value]

The displayed value is returned in the format specified by watchOption.

When watchOption is specified as "WatchOption.Auto", the format is returned to match the variable value.

However, if the return value is a double type, it is returned as a string (when watchOption is specified as "WatchOption.Double", or watchOption is specified as "WatchOption.Auto" and the return value is a double type).

[Detailed description]

-

This function displays the value of the variable specified by variableName.

-

If encode is specified, then perform encoding using encode.

-

If watchOption is specified, display according to watchOption.

Caution

When a load module name or file name is specified as a variable (variableName), it needs to be enclosed in double quotation marks (" ") in some cases. See "CS+ Integrated Development Environment Users Manual: Debug Tool" for details.

Example

When file name "C:\path\test.c" and variable "var" are specified

"\"C:/path/test.c\"#var"

Or

"\"C:\\path\\test.c\"#var"

[Example of use]

>>>debugger.Watch.GetValue("testVal")
128
>>>debugger.Watch.GetValue("testVal", WatchOption.Hexdecimal)
0x80
>>>debugger.Watch.GetValue("testVal", WatchOption.Binary)
0b10000000