PowerAda The Source Browser

From OC Systems Wiki!
Jump to: navigation, search

The Source Browser is a powerful tool that allows you to examine units compiled into the current library. Operations include:

Basic Usage

Opening a Browser

You may open a browser from the debugger Main Window, Browse Units Window, or by cloning a window (see "Cloning Windows" for more information.)

Selecting Ada Constructs

To select Ada constructs, click the middle mouse-button, or hold down shift and left-click on the mouse. This will highlight the Ada construct nearest the mouse pointer.

Making Queries

Holding down the right mouse button while the pointer is on the Ada source will bring up a small menu of common actions. These actions operate on the currently selected Ada construct.

Subprogram and Variable Definitions

The most common query is definition. This brings you to the "right" construct in relation to the currently highlighted construct. For instance, the definition of a variable will be its declaration, and the declaration's definition will be its type declaration. The definition of a package body is its specification, and vice-versa.

Going Back

Often, after making a query, you may wish to go back to the window in which the query was made (or to the window before it, and so on). For instance, the definition of a subprogram body may bring you to a different file, which you only wish to glance at. You can return to the body using the previous view button. Just click Previous under the View pulldown, or press Ctrl-P.

Cloning Windows

Cloning a window creates an identical copy of the window. This is useful if you want to perform queries on a unit while still looking at the unit itself. To clone a window, select Clone Window from the File pulldown.

Advanced Usage

Editing A Local Copy of Code

Clicking Edit File under the File pulldown will open the editor (See Setting Your Preferences) on the current file. If the file cannot be found, you will be asked if you want to extract the source from the library. Doing so will give you an exact version of the source which is compiled into the library.

Local Uses

Clicking Local Uses under the Source menu will highlight all the local appearances of the selected construct. It will also open a list at the top of the browser that allows you to jump to each usage.

Searching Through Code

Clicking Find under the Source pulldown will allow you to search the current unit for a text string, or a number of Ada constructs. See Find Dialog for more information.

Viewing an Outline of Your Code

Clicking the Outline button under the View pulldown will open a list containing an outline view of the current unit. This outline contains all the subprograms in the unit. Clicking on a line in the outline list will move the source display to that line.

You can also use the Find All feature of the Find Dialog to make customized outlines.

See also: CHAPTER 6, "Unit Browser" in the PowerAda User's Guide.