Totalview® for HPC Reference Guide : PART I Using the CLI : Chapter 3 CLI Namespace Commands : scope
scope
Sets and gets internal scope properties
Format 
TV::scope action [ object-id ] [ other-args ]
Arguments 
action
The action to perform, as follows:
cast
Attempts to find or create the type named by the other-args argument in the given scope.
code_unit_by_soid
Look up loader symbols by using a regular expression to match the base name. For example:
TV::scope lookup $scope_id \
loader_sym_by_regexp \
"regular expression"
commands
Displays the subcommands that you can use. The CLI responds by displaying the subcommands shown here. Do not use additional arguments with this subcommand.
create
Allows you to create blocks, enum_type, named_constant, typedef, upc_shared_type, and variable symbols. The type of symbol determines the properties you meed to specify. In all cases, you must specify the kind property. If you are creating a located symbol such as a block, you need to provide a location. If you are creating a upc_shared_type, you need a target_type index.
dump
Dump all properties of all symbols in the scope and in the enclosed scope.
get
Returns properties of the symbols whose soids are specified. Specify the kinds of properties using the other-args argument.
If you use the -all option instead of object-id, the CLI returns a list containing one (sublist) element for each object.
lookup
Look up a symbol by name. Specify the kind of lookup using the other-args argument. The values you can enter are:
by_language_rules: Use the language rules of the language of the scope to find a single name.
by_path: Look up a symbol using a pathname.
by_properties [proptery_regexp_pair]: TotalView recurses down the scope tree after it visits a symbol. This means TotalView will search for matching symbols in the specified scope and any nested scope. The walk property shows an example.
by_type_index: Look up a symbol using a type index.
in_scope: Look up a name in the given scope and in all enclosing scopes, and in the global scope.
lookup_keys
Displays the kinds of lookup operations that you can perform.
properties
Displays the properties that the CLI can access. Do not use additional arguments with this option. The arguments displayed are those that are displayed for the scope of all types. Additional properties also exist but are not shown.(Only the ones used by all are visible.) For more information, see TV::symbol.
walk
Walk the scope, calling Tcl commands at particular points in the walk. The commands are named using the following options:
by_properties [proptery_regexp_pair]: TotalView recurses down the scope tree after it visits a symbol. This means TotalView will search for matching symbols in the specified scope and any nested scope. For example:
TV::scope walk $scope_id by_properties \
kind typedef base_name "^__BMN_.*$"
-pre_scope tcl_cmd: Names the commands called before walking a scope.
-pre_sym tcl_cmd: Names the commands called before walking a symbol.
-post_scope tcl_cmd: Names the commands called after walking a scope.
-post_symbol tcl_cmd: Names the commands called after walking a symbol.
tcl_cmd: Names the commands called for each symbol.
object-id
The ID of a scope.
other-args
Arguments required by the get subcommand.
Description 
The TV::scope command lets you examine and set a scope’s properties and states.
Examples 
TV::scope create $scope kind [kind] \
[required_property_regexp_pair]...
[non-required_property_regexp_pair]...
This is the general specification for creating a symbol
TV::scope create 1|31 kind block location {ldam 0x12}
Create a block. A block should have a length. However, you can set the length later using the set property.