You can override Prism's procedure for resolving names by qualifying the name.
A fully qualified name starts with a back-quotation mark (`). The symbol farthest to the left in the name is the load object, followed optionally by the file, followed optionally by the procedure, followed by the variable name. Each is preceded by a backquote (`). Examples of Prism's identifier syntax are shown in Table 2-4.
Table 2-4 Prism Identifier Syntax
Syntax |
Description |
---|---|
a |
Specifies the variable a in the current scope. An error will be reported if no variable a exists in the current scope. |
`a |
Specifies the variable a in the global scope. |
``a |
Specifies the variable a in the global or file-static scope. |
`foo.c`a |
Specifies the variable a in file foo.c. |
`foo.c`foo`a |
Specifies the a in the procedure foo in the file foo. |
`foo`a |
Specifies the variable a in function foo (if foo is active). |
`a.out`foo.c`foo`a |
Specifies the variable a in function foo in file foo.c in load object a.out. |
`a.out`foo.c`foo:line`a |
Specifies the variable a in function foo at line number line in file foo.c in load object a.out. |
`foo.x`foo.cc`Bar::print:71`dummy |
Specifies the variable dummy in member function print of class Symbol at line number 71 in file foo.cc in load object foo.x. |
"foo.c":line |
Specifies the line number line in the file foo.c. Note the use of double quotes. |
Partially qualified names do not begin with `, but have a ` in them. For example,
foo`a
In this case, Prism looks up the function name on the left first and picks the innermost symbol with that name that is visible from your current location. This is useful primarily in referring to variables in routines on the call stack.
Use the whereis command to display a list of all the fully qualified names that match the identifier you specify.
Prism assigns its own names (using the function:line syntax, where function is the function and line is the line number where the variable declaration appeared) to variables in local blocks of C code. This disambiguates variable names, in case you reuse a variable name in more than one of these local blocks.
When debugging Fortran, Prism attempts to be case-insensitive in interpreting names, but will use case to resolve ambiguities.