Identifies the current scope search list for symbol lookup. Format SHOW SCOPE
1 – Description
The current scope search list designates one or more program locations (specified by path names or other special characters) to be used in the interpretation of symbols that are specified without pathname prefixes in debugger commands. The current scope search list is the scope search list last established with the SET SCOPE command. By default, if you did not enter a SET SCOPE command, the current scope search list is 0,1,2, . . . ,n. The default scope search list specifies that, for a symbol without a pathname prefix, a symbol lookup such as EXAMINE X first looks for X in the routine that is currently executing (scope 0); if no X is visible there, the debugger looks in the caller of that routine (scope 1), and so on down the call stack; if X is not found in scope n, the debugger searches the rest of the run-time symbol table (RST)-that is, all set modules and the global symbol table (GST), if necessary. If you used a decimal integer in the SET SCOPE command to represent a routine in the call stack, the SHOW SCOPE command displays the name of the routine represented by the integer, if possible. Related commands: (SET,CANCEL) SCOPE
2 – Examples
1.DBG> CANCEL SCOPE DBG> SHOW SCOPE scope: * 0 [ = EIGHTQUEENS\TRYCOL\REMOVEQUEEN ], 1 [ = EIGHTQUEENS\TRYCOL ], 2 [ = EIGHTQUEENS\TRYCOL 1 ], 3 [ = EIGHTQUEENS\TRYCOL 2 ], 4 [ = EIGHTQUEENS\TRYCOL 3 ], 5 [ = EIGHTQUEENS\TRYCOL 4 ], 6 [ = EIGHTQUEENS ] DBG> SET SCOPE/CURRENT 2 DBG> SHOW SCOPE scope: 0 [ = EIGHTQUEENS\TRYCOL\REMOVEQUEEN ], 1 [ = EIGHTQUEENS\TRYCOL ], * 2 [ = EIGHTQUEENS\TRYCOL 1 ], 3 [ = EIGHTQUEENS\TRYCOL 2 ], 4 [ = EIGHTQUEENS\TRYCOL 3 ], 5 [ = EIGHTQUEENS\TRYCOL 4 ], 6 [ = EIGHTQUEENS ] DBG> The CANCEL SCOPE command restores the default scope search list, which is displayed by the (first) SHOW SCOPE command. In this example, execution is suspended at routine REMOVEQUEEN, after several recursive calls to routine TRYCOL. The asterisk (*) indicates that the scope search list starts with scope 0, the scope of the routine in which execution is suspended. The SET SCOPE/CURRENT command resets the start of the scope search list to scope 2. Scope 2 is the scope of the caller of the routine in which execution is suspended. The asterisk in the output of the (second) SHOW SCOPE command indicates that the scope search list now starts with scope 2. 2.DBG> SET SCOPE 0,STACKS\R2,SCREEN_IO,\ DBG> SHOW SCOPE scope: 0, [= TEST ], STACKS\R2, SCREEN_IO, \ DBG> In this example, the SET SCOPE command directs the debugger to look for symbols without pathname prefixes according to the following scope search list. First the debugger looks in the PC scope (denoted by 0, which is in module TEST). If the debugger cannot find a specified symbol in the PC scope, it then looks in routine R2 of module STACKS; if necessary, it then looks in module SCREEN_IO, and then finally in the global symbol table (denoted by the global scope (\)). The SHOW SCOPE command identifies the current scope search list for symbol lookup. No asterisk is shown in the SHOW SCOPE display unless the default scope search list is in effect or you have entered a SET SCOPE/CURRENT command.