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. The expression itself can, however, be edited 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 perform the evaluation.
The following rules apply to the names of the resources in the target:
  • Registers must be entered in the form:
    If the register name is unique for the whole target the following shorthand notation can be used:
  • Pipeline stage fields must be entered in the form:
  • Memory locations must be entered in the form:
    The content of a memory location is queried with the following expression:
    The delivered pointer can be type cast into any required type:
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).
Combine resources, variables and literals in the target with operators to form complex expressions. 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
[] -> .
Left to right
! ~ + - * & (unary) (cast) sizeof
Right to left
* (binary) / %
Left to right
+ - (binary)
Left to right
<< >>
Left to right
< <= > =>
Left to right
== !=
Left to right
& (binary)
Left to right
Left to right
Left to right
Left to right
Left to right
Left to right
This section contains the following subsections:
Non-ConfidentialPDF file icon PDF versionARM DUI0314Q
Copyright © 2007-2014 ARM. All rights reserved.