| |||
| Home > armsd > Getting Started in armsd > Specifying source-level objects > Variable names and context | |||
You can usually refer to variables by their names in the original source code. To print the value of a variable, type:
print variable
With structured high-level languages, you can access variables defined in the current context by giving their names. Other variables must be preceded by the context (for example, the name of the function) in which they are defined. This also gives access to variables that are not visible to the executing program at the point at which they are being examined. The syntax is:
procedure:variable
You can access global variables by qualifying them with the
module name or filename if there is any ambiguity. For example,
because the module name is the same as a procedure name, you must
prefix the filename or module name with #. The
syntax is:
#module:variable
If a variable is declared more than once within the same procedure, resolve the ambiguity by qualifying the reference with the line number in which the variable is declared in addition to, or instead of, the function name:
#module:procedure:line-no:variable
To pick out a particular activation of a repeated or recursive function call, prefix the variable name with a backslash (\) followed by an integer. Use 1 for the first activation, 2 for the second, and so on. A negative number looks backwards through activations of the function, starting with \-1 for the previous one. If no number is specified and multiple activations of a function are present, the debugger always looks at the most recent activation.
To refer to a variable within a particular activation of a function, use:
procedure\{-}activation-number:variable
The complete syntax for the various ways of expressing context is:
{#}module{{:procedure}*
{\{-}activation-number}}
{#}procedure{{:procedure}*
{\{-}activation-number}}
#