Sun Studio 12: Debugging a Program With dbx

Scope Resolution Search Path

When you issue a debugging command that contains an expression, the symbols in the expression are looked up in the following order. dbx resolves the symbols as the compiler would at the current visiting scope.

  1. Within the scope of the current function using the current visiting scope (see Visiting Scope). If the program is stopped in a nested block, dbx searches within that block, then in the scope of all enclosing blocks.

  2. For C++ only: class members of the current function's class and its base class.

  3. For C++ only: the current name space.

  4. The parameters of the current function.

  5. The immediately enclosing module, generally, the file containing the current function.

  6. Symbols that were made private to this shared library or executable. These symbols can be created using linker scoping.

  7. Global symbols for the main program, and then for shared libraries.

  8. If none of the above searches are successful, dbx assumes you are referencing a private, or file static, variable or function in another file. dbx optionally searches for a file static symbol in every compilation unit depending on the value of the dbxenv setting scope_look_aside.

dbx uses whichever occurrence of the symbol it first finds along this search path. If dbx cannot find the symbol, it reports an error.