4.5.3 Evaluating Expressions
To evaluate a language expression, use the EVALUATE
command as follows:
DBG> EVALUATE lang_exp
The debugger recognizes the operators and expression syn-
tax of the currently set language. In the following example,
the value 45 is assigned to the integer variable WIDTH; the
EVALUATE command then obtains the sum of the current
value of WIDTH plus 7:
DBG> DEPOSIT WIDTH = 45
DBG> EVALUATE WIDTH + 7
52
DBG>
Following is an example of how the EVALUATE and the
EXAMINE commands are similar. When the expression fol-
lowing the command is a variable name, the value reported
by the debugger is the same for either command.
DBG> DEPOSIT WIDTH = 45
DBG> EVALUATE WIDTH
45
DBG> EXAMINE WIDTH
SIZE\WIDTH: 45
Following is an example of how the EVALUATE and
EXAMINE commands are different:
DBG> EVALUATE WIDTH + 7
52
DBG> EXAMINE WIDTH + 7
SIZE\WIDTH: 131584
With the EVALUATE command, WIDTH + 7 is interpreted
as a language expression, which evaluates to 45 + 7, or 52.
With the EXAMINE command, WIDTH + 7 is interpreted
as an address expression: 7 bytes are added to the address
of WIDTH, and whatever value is in the resulting address is
reported (in this example, 131584).