2.6 Watch window and Expression Evaluator

The Expression Evaluator is located in the Watch window.

To display the window, select Window > New View > New Watch Window .

Figure 2-43 Watch window
Watch window


There are two types of entry in the Watch window:

System variables

Entries in this group are marked with small icons to the left of their name to indicate their origin. They can be manipulated in the Watch window in the same way as in their original view. Items in this category include:

  • Registers.

  • Memory locations.

  • Pipeline fields.

  • Variables from source code.

Expressions for evaluation

These items do not have an associated icon because they are not duplicates of an item in a different view. They cannot have breakpoints set and their value cannot be changed. However, you can edit the expression itself by text in the Name column.

Double click in the left column of an existing entry to add a breakpoint for that variable.

Double click in the right column of an existing entry to edit the contents.

Double click on the last entry in the left column to enter a new expression. Press the Enter key to evaluate the expression.

The following rules apply to the names of the resources in the target:

  • Registers must be entered in the form:

    $registerGroup.registerName
    

    If the register name is unique for the whole target, the following shorthand notation can be used:

    $registerName
    
  • Pipeline stage fields must be entered in the form:

    @pipelineStage.fieldName
    
  • Memory locations must be entered in the form:

    memorySpace:address
    

    The content of a memory location is queried with the following expression:

    *memorySpace:address
    

    The delivered pointer can be type cast into any required type:

    (typeName*)memorySpace:address
    

The variables of the software running on top of the target processor can be entered using an expression as they appear in the software. They do not require a prefix or quotes. Access components of structs or unions with the '.' or '->' operator according to the C syntax.

Numeric values can be entered in the following formats:

Integer values

Integer values can have binary, octal, decimal, or hexadecimal representation. The prefix indicates the representation format:

  • Binary numbers have a leading 0b.

  • Octal numbers a leading 0.

  • Hexadecimals have a leading 0x.

  • Literals with no prefix are interpreted as decimals.

Floating-point values

Floating-point values can have decimal and scientific representation.

Enter floating-point values in decimal representation (123.456) or in scientific representation with positive or negative exponent (1.23456e2).

To form complex expressions, combine resources, variables, and literals in the target with operators. The expression evaluator has the same operands as the C language and has the same precedence and associativity of operators. Inside the complex expression, the resources of the target can be used if an integer value would be sufficient in a regular C expression.

Table 2-2 Operator precedence

Precedence Operators Associativity

1

[] -> .

Left to right

2

! ~ + - * & (unary) (cast) sizeof

Right to left

3

* (binary) / %

Left to right

4

+ - (binary)

Left to right

5

<< >>

Left to right

6

< <= > =>

Left to right

7

== !=

Left to right

8

& (binary)

Left to right

9

^

Left to right

10

|

Left to right

11

&&

Left to right

12

||

Left to right

13

?:

Left to right

This section contains the following subsection:
Non-ConfidentialPDF file icon PDF version100968_1142_00_en
Copyright © 2014–2018 Arm Limited or its affiliates. All rights reserved.