PowerAda How do I …
- 1 How do I contact OC Systems excellent technical support?
- 2 How do I get my existing source quickly compiled with PowerAda?
- 3 How do I create a new project?
- 4 Do I have to create a project?
- 5 How do I get source into the project?
- 6 How do I compile the source?
- 7 How do I link a program?
- 8 How do I run the program?
- 9 How do I debug the program?
- 10 How do I change the fonts and colors?
- 11 How do I create a new directory in my working project?
- 12 How do I create a new file?
- 13 How do I reference stuff I've already compiled in another directory?
- 14 How do I reference stuff that's already compiled outside the project?
- 15 How do I compile a C file?
- 16 How do I link in an external object file?
- 17 How do I get the CM menu operations to work?
- 18 How do I find the compile options of a file?
- 19 How do I recompile with different options?
- 20 How do I compile Ada files outside powerada?
- 21 How do I make changes to a baseline?
- 22 How do I view a language-defined package like text_io?
- 23 How do I get a window with all my local files in it?
- 24 How do I see what will be recompiled because of a change I made?
- 25 How do I see what units will have to be recompiled if I change this unit?
- 26 How do I get to the source browser view from the text view?
- 27 How do I get to the source browser from the file list?
- 28 How do I jump to the declaration of a variable?
- 29 How do I see all uses of a variable?
How do I contact OC Systems excellent technical support?
- E-mail support -at- ocsystems.com
- FAX 703-279-2799
- Voice 703-359-8160
- Post 9990 Lee Highway, Suite 270, Fairfax, VA 22030
How do I get my existing source quickly compiled with PowerAda?
Try this, from the command line:
- Copy all the source into a directory tree, let's call it
- Suppose you have a main program that's in
- Set up the PowerAda environment: e.g., .
- Run this "build_from_scratch" example script with the root directory and main program file:
$POWERADA/examples/scripts/build_from_scratch \ /pa_test main/main.ada
If you're porting from another compiler you'll have some errors to fix up, but this will create a project and some configuration files to get started with.
How do I create a new project?
Do I have to create a project?
If you want to work in the powerada GUI, yes. If you want to work at the command-line, no, not really. The Example in CHAPTER 2, "Getting Started", shows how you can just compile a file into a single sublibrary. The section on Alternate Libraries in CHAPTER 3, "Basic PowerAda Concepts" describes how things worked in PowerAda version 2, which didn't have projects, and all the non-project command-line tools like abuild, ada, alibinit, and areport are still available.
How do I get source into the project?
You can convert an existing source tree into a project by designating an existing directory as the project root when creating it.
To move a source tree, create the project then use the mv command from the command line.
How do I compile the source?
Use the operations in the powerada Build Menu, as described in the Getting Started Demo. You can use the command-line as described in the Multiple Directories Demo or using the shell script
$POWERADA/examples/scripts/build_from_scratch. Or you can just compile with the ada command as shown in the "Example" in Chapter 2.
How do I run the program?
In powerada, choose Run Program from the Directory or File menu, or from the command line, just type the path of the executable file.
How do I debug the program?
In powerada, choose Debug Program from the Directory or File menu, or from the command line, type
adbg followed by the path of the executable file.
How do I change the fonts and colors?
How do I create a new directory in my working project?
How do I create a new file?
How do I reference stuff I've already compiled in another directory?
Assuming you compiled within a project within powerada, that "stuff" went into a sublibrary named
adalib in the same directory as the source. So to compile files that reference units in that other sublibrary, you need to include the project-relative name of
another_directory/adalib in a sublibrary imports file called
adalib.imports in your current directory.
How do I reference stuff that's already compiled outside the project?
Name the compilation unit that is compiled into external sublibrary an in a with clause in the Ada source file in your current directory, and add the fully qualified name of this external sublibrary to your local sublibrary imports file,
How do I compile a C file?
There is no GUI support for compiling with C. Choose New Shell Window from the Project menu, and use the C compiler of your choice to compile the file. You may need to buy a compiler from IBM, or use
You can specify it as one of the "Non-Ada Archive, Object Files" under the Bind Options tab of the Build Options Dialog, or in one of the several ways described in CHAPTER 7, "Linking With Foreign Object Code".
PowerAda supports one of several third-party CM systems. If you don't see a CM menu at all, then the "none" option was chosen at installation time. If you have a CM menu but the specified operations don't work, then the system that was selected is not installed properly.
To determine the system that is currently selected, choose Environment Variables from the Environment cascaded menu in the Project Menu and select PACM_CM_SYSTEM. Its value will be that of the chosen system, e.g., CMVC.
For more information, see CHAPTER 5, "Choosing a CM System", or see your system adminstator.
How do I find the compile options of a file?
In a powerada, you can choose Visit Compiled Unit for the file, which will put you in a Source Browser View. Then select Unit Info from the Source menu to see the compile options and other information; or you can choose Show Compile Options from the Show Columns cascaded menu in one of powerada's Unit Views.
From the command line, use
areport -Wlf filename
to see lots of information about the specified file, including the options (shown in quotes).
How do I recompile with different options?
- Choose Load from the Build menu
- Click the Options button
- Choose the Build Options tab
- Set the Always load/compile toggle
- Clear the Inherit options toggle button
- Choose the Compile Options tab
- Check the toggles you want, or enter other ada command line options in the type-in labeled Other options.
- Click Ok in the Build Options Dialog.
- Click the Preview button to confirm that your file(s) will be compiled as desired.
- Click the Load button to load the file(s).
Or, from the command line, use the ada command with the desired options and filenames.
How do I compile Ada files outside powerada?
The tool to use outside of powerada but within a project is aprojbuild. This is the tool invoked by the Powerada Build Windows, and uses the project library and sublibrary imports file as described in "Project Libraries and Sublibraries" in Chapter 3.
Outside of a project, you can use abuild. For a single directory full of source, you can just type
ls *.ada | abuild -vI
and then bind your main program with
abuild -vb main_unit_name
For multiple sublibraries, you build each sublibrary by naming it at the top of an library list file (alib.list), followed by the names of all the sublibraries directly or indirectly needed by the program, as described in CHAPTER 3, "Alternate Libraries".
How do I make changes to a baseline?
In general, you don't: instead, you:
- create a working project that has the baseline project to be changed as its parent baseline.
- compile your changes into the working project.
- use Baseline Project to convert the working project to a baseline.
- change the baselines file named by the POWERADA_BASELINES environment variable, in which the alias for the original baseline appeared, to reference the new baseline containing the changes. Or, simply inform users to do a Change Baseline to the new baseline you created.
If you feel you must change an already baselined project. Make sure nobody else is referencing it, perhaps by temporarily moving it and seeing if anybody noticies.
Then, from the command line, execute
aprojbaseline -vu baseline_name
to "unbaseline" the baseline. Now, from either powerada or the command line, you can copy the changed source files over the existing ones in the baseline, and compile them into the corresponding sublibrary. When the changes have been compiled in, you can baseline the project again with Baseline Project menu item or with
How do I view a language-defined package like text_io?
- Look in the index of LRM83 or RM95.; or
- Choose Visit Library in a directory that has some compiled units (locally or in a baseline) and double-click on the desired unit in the resulting list; or
- Click the Search button on the button bar, and in the dialog specify
Find Unit in Library whose name Contains text_ioor, if you have a baseline project:
Find Unit in Full Project whose name Contains text_io.
Then double-click on the desired unit in the resulting list.
How do I get a window with all my local files in it?
Click the Search button, and change the contents of the dialog to read: Find Files in Working Project whose name Contains: *
How do I see what will be recompiled because of a change I made?
How do I see what units will have to be recompiled if I change this unit?
In one of the Unit Views (reached by Visit Sublibrary, for example), select the unit to be changed. Then choose Unit Reports from the Sublibrary (or Library, or Unit) menu. This brings up the Unit Reports Dialog. Select the Reference Library you want to search, set the Report Type to dependents, and click Start. Click Ok in the "Done" dialog to view the resulting list.
How do I get to the source browser view from the text view?
Type Ctrl-V, or choose Visit Compiled Unit from the Popup Menu or the Visit/Visit In New cascaded menu in the Go Menu. If there is a corresponding compiled unit available, you will be positioned at the same place in that Source Browser View.
How do I get to the source browser from the file list?
How do I jump to the declaration of a variable?
In a Source Browser View, find a reference to the variable, and put the cursor over it. Single-click with the middle mouse button to highlight the variable, then do one of:
- Type Ctrl-V (Visit) or Ctrl-D (Definition Of);
- Click the Visit button in the Buttonbar;
- Choose Visit Selected Item from the Popup Menu;
- Choose Definition Of from the Source menu;
- Choose Visit Selected Item from the Visit/Visit In New cascaded menu in the Go Menu.
How do I see all uses of a variable?
The reference to the variable must be in a compiled unit. View that unit in a Source Browser View with by choosing Visit Compiled Unit from the Go Menu or the Popup Menu. Find a reference to the variable, and put the cursor over it. Single-click with the middle mouse button to highlight the variable. To find all uses within the current unit, choose Local Uses from the Source menu. To pop up a dialog from which to search the entire project for uses of the variable, choose Global Uses from the Source menu.