In This Book

Overriding the Current Language

The debugger uses the source language of the current environment when evaluating expressions. You can use the property language command to change the language of evaluation, or you can use the print -languagecommand to override the default language used to evaluate a single expression.

For example, when the current environment is using the C language manager, you can use FORTRAN as the language of evaluation for a command:

property language fortran

Now, although C is the language that corresponds to the current environment, you can evaluate a FORTRAN expression:

break 32 -do[if a.eq.b -then print a]

These commands are fully described in the online command reference.

Applying Scope and Visibility Rules

The debugger applies certain scope and visibility rules to ￿nd symbols.

The debugger ￿rst searches within the block that contains the current location. If the symbol is found, the search is completed. If the symbol is not found, the debugger searches outer, encompassing blo cks. A symbol in the outer, encompassing block is visible to the inner block as long as no symbol of the same name exists in the inner block. See Figure 7-1 for an example.

If the search within the scope of the current environment fails, the debugger applies additional rules to locate the name. The following is a summary of the debugger's search order:

1.The block containing the current location.

2.Outer encompassing bloc ks (lexical paren ts).

3.The prede￿ned language ( `predefined ) block.

4.The user-declared bloc k (`declared ).

5.Global sym bols and top-level procedures (external).

7-4 Identifying Program Objects