| |||
| Home > RealView Debugger Commands > Alphabetical command reference > SCOPE | |||
The SCOPE command specifies the current module and procedure scope.
SCOPE /F
SCOPE root_name\\
SCOPE [root_name\\] module_name
SCOPE [[root_name\\] module_name\]
{function_name | (expression)
| @stack_level | #line_number}]
where:
/FSelects the first module of the next root.
root_nameSpecifies
the name of a root (for example, @sieve).
module_nameSpecifies
the name of a module (for example, SIEVE).
function_nameSpecifies the name of a function (for example, proc1).
expressionSpecifies an expression specifying the location of a calling function.
stack_levelSpecifies a stack level.
line_numberSpecifies a high-level line number.
The SCOPE command specifies the current module and procedure scope. This determines the current context. The current context determines how local variables are accessed and what symbol qualification is required. The following context types are supported:
the current PC
a specific module, function, or source file line
a stack frame position
auto-set, used when the debugger is in source mode and the PC is not in a source view context, for example when the program is at the entry point.
The SCOPE command can change the default root, module, procedure, line number, or stack level, but it does not change the PC.
To return the scope to display source at the current PC location, use SCOPE with no parameters. To display the current scope, use the CONTEXT command.
The current root and module is the default when line numbers
and local symbols are referenced without a module or procedure qualifier.
For example, if line number 3 is entered on the command line as #3,
it is interpreted as default_module\#3. The new source
file or disassembly is shown in the Code window.
The SCOPE command runs asynchronously. Use the WAIT command to force it to run synchronously.
The following examples show how to use SCOPE:
scope #155Set the current context to line 155 in the current module (file).
Scoped to: (0x01000560): DHRY_1\main Line 155
sc \\DHRY_1Set the current context to the start of the file dhry_1.c.
Scoped to: (0x010002BC): DHRY_1\main Line 78
sc @1Set the scope to the stack frame of the calling function.
scReturn the current context to the execution point.
At the PC: (0x01000544): DHRY_1\main Line 152