TOC PREV NEXT INDEX DOC LIST MASTER INDEX




Using Pathnames

Objects in the program can be referenced explicitly using strings called pathnames. Pathnames:

Pathnames are discussed in further detail in Using the Apex Debugger.

Fully Qualified Pathnames

For Ada

Every object in the program being debugged has a unique, fully qualified pathname that reflects the object's unique location in the source, and program execution. An example of a fully qualified pathname is:

In this example, Airline_Reservations is the package containing the Make_Res procedure which contains the Down_Message variable.

For C/C++

The :: operator can be used in a debugger pathname to associate an identifier with a specific class or struct. This is sometimes necessary to reference a class or struct member that is hidden by a locally defined identifier. An example of this kind of fully qualified pathname is:

where Seat_Services is a class and status is a data member of the class. If the local context was within the body of a member function of Seat_Services with a local variable "status", then a fully qualified pathname would be needed to reference Seat_Services::Status.

The other use of the :: operator is to reference names from the global scope. An example of this find of fully qualified pathname is:

Relative Pathnames

For Ada

Although you can always refer to an object using its fully qualified pathname, it is often more convent to use a relative pathname instead. A relative pathname traces the path to an object starting from some environment or debugger location other than the root world (for a source location or static variable) or named task for a dynamic variable). Thus, if you want to reference an object that is "in the neighborhood" of your current location in the Environment or in the debugger, you can use a relative pathname to specify the object relative to your current location.

A given relative pathname for an object:

Relative pathnames are shorted than fully qualified pathnames because the debugger uses the context to fill in the missing name components. An example of a relative pathname is:

When the context is the Airline_Reservations package, the relative name refers the same object as the fully qualified pathname in the previous example.

For C/C++

In a normal debugging scenario, relative debugger pathnames are usually preferred because they are shorter. SInce a relative debugger pathname does not use the :: operator, the debugger resolves the first simple identifier in the pathname in the context determined by the current focus in the program being debugged. Within a member function, the member names can be referenced by their simple identifiers. For example, within a member function Call_Attendant or class Seat_Services, the member Light_Status is directly visible without qualification.

If the first identifier of a relative pathname cannot be resolved in a given local context using the C/C++ name resolution rules, the debugger looks for the name among the global names.

Overloading

If the search finds multiple definitions for the same name, the debugger issues a message displaying each of the possible alternatives. The notation is simple_name'n, where n is a number (for example., sin'2). An example of the debugger message follows.

For Ada

For C/C++

Append the suffix 'n to the subprogram/function name to indicate precisely the name to reference, where n is one of the numbers listed in the overloading message.

The debugger assigns a number to each occurrence of a simple name, starting with 1. These numbers remain constant throughout the debugging session.


Rational Software Corporation 
http://www.rational.com
support@rational.com
techpubs@rational.com
Copyright © 1993-2001, Rational Software Corporation. All rights reserved.
TOC PREV NEXT INDEX DOC LIST MASTER INDEX TECHNOTES APEX TIPS