The debugger maintains a list of special variables which are not a part of your program, but can be used in the debugger as if they were. For example, you could use a special variable in an expression that you evaluate in the debugger. These special variables include machine registers (such as $r1), debugger internal variables (such as $_DISPMODE), and user defined variables (such as $foo).
When the debugger is evaluating an expression and it finds a variable name (such as result), it first performs a scope search in the program to see if the variable exists. If the variable does not exist, then the list of special variables is searched. Variable names beginning with a dollar-sign `$' (such as $result) are assumed to be special variables.
User-defined special variables are of the same type as the last expression assigned. For example, entering:
$mumble=3*4 |
creates the special variable $mumble, assigns it the value 12, and makes its type integer. These variables are just like any other variables, except you may not take the address meaningfully.
The processor's registers are included as predefined variables. To find which register names are available on your system, you can list the registers with the l (lowercase `L') command with the r option:
l r |
See l.
All registers act as integers of the correct size for the register. Special care should be exercised when modifying the contents of registers while debugging high-level code, since the results of these modifications can often produce unpredictable effects.
The following special predefined variable is also included:
To list all the other special variables, use the l (lowercase `L') with the s option.
l s |
See l.