2.3.116. SCOPE

Specifies the current module and procedure scope.



SCOPE root_name\\

SCOPE [root_name\\] module_name

SCOPE [[root_name\\] module_name\] {function_name | (expression) | @stack_level | #line_number}



Selects the first module of the next root.


Specifies the name of a root (for example, @sieve).


Specifies the name of a module (for example, SIEVE).


Specifies the name of a function (for example, proc1).


Specifies an expression specifying the location of a calling function.


Specifies a stack level.


Specifies 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 #155

Set the current context to line 155 in the current module (file).

Scoped to: (0x01000560): DHRY_1\main Line 155
sc \\DHRY_1

Set the current context to the start of the file dhry_1.c.

Scoped to: (0x010002BC): DHRY_1\main Line 78
sc @1

Set the scope to the stack frame of the calling function.


Return the current context to the execution point.

At the PC: (0x01000544): DHRY_1\main Line 152

See also

Copyright © 2002-2011 ARM. All rights reserved.ARM DUI 0175N