HPlogo HP/DDE Debugger User's Guide: HP 9000 Series 700/800 Computers > Chapter 7 Identifying Program Objects

Applying Scope and Visibility Rules

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

The debugger applies certain scope and visibility rules to find symbols.

The debugger first 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 blocks. 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 “Sample Module Illustrating Scope and Visibility ” 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 blocks (lexical parents).

  3. The predefined language (`predefined) block.

  4. The user-declared block (`declared).

  5. Global symbols and top-level procedures (external).

NOTE: Special language-specific search rules can also be used. For example, when debugging C++ programs, you can find class members.

Figure 7-1 Sample Module Illustrating Scope and Visibility

[Sample Module Illustrating Scope and Visibility]

In addition, you can explicitly reference symbols outside the scope of the current environment by using qualified names. The following section describes the syntax for using qualified names.