There are several different methods for viewing the value of variables, including the following:
MULTI's expression evaluator accepts the following forms of variable notations. You can use them to unambiguously refer to a specific variable even when there are other variables with the same name.
Note: Previous releases of MULTI did not support all of the following forms.
The following list describes the different methods for specifying variable names and memory addresses. Note that an arbitrary variable called fly is used in these examples. Spaces before and after the `#' symbol are optional, but the pair of double quotes (" ") around a file name is required. Local variables need to be either static or within a procedure on the stack.
Viewing variables | |
---|---|
Expression | Meaning |
fly |
Performs a scope search for the variable fly, starting at the "stop point" in the current procedure and proceeding outwards. Locals, local statics, and parameters are checked, then file statics, globals, and special variables. |
$fly |
Searches the list of special variables for $fly. See
"Special variables". |
:fly |
Searches for a global named fly. |
::fly |
Same as :fly. |
num # fly |
Uses the num procedure on the call stack for the scope search. Caution: if entered directly into the debugger, the debugger will jump to line num instead of what you intended. To avoid this, use parentheses to enclose the expression at the beginning of the command line. This is useful if you are debugging a recursive procedure and multiple instances are on the stack. You can then pick the instance and display the value of the variable for that instance. See
e. |
"foo.c" # proc ## label # fly |
Local variable fly in the lexical block at label label in procedure proc in file foo.c. |
proc ## label # fly |
Local variable fly for block at label label in procedure proc. |
stack_depth ## label # fly |
Local variable fly in the lexical block at label label in procedure at stack depth stack_depth. |
"foo.c" # proc # fly |
Local variable fly for procedure proc in file foo.c. |
proc # fly |
Local variable fly for procedure proc. |
stack_depth # fly |
Local variable fly for procedure at stack depth stack_depth. |
stack_depth ## fly |
Local variable fly for procedure at stack depth stack_depth. |
"foo.c" # fly |
Static variable fly in file foo.c. |
. (period) |
The period is a symbol that represents the result of the latest expression. |