Before you can execute or debug a program in Prism, you must first load the program into Prism. You can load only one program at a time.
As described in Chapter 2, Using Prism, you can load a program into Prism by specifying its name as an argument to the prism command. If you don't use this method, you can load a program once you are in Prism by using one of the methods discussed next.
Choose the Load selection from the File menu. (It is also by default in the tear-off region.) A dialog box appears, as shown in Figure 3-1.
To load a program, you can simply double-click on its name, if the name appears in the Programs scrollable list. Or, you can put its path name into the Selection box, then click on Load. To put the file's path name into the Selection box, you can either type it directly in the box or click on its name in the Programs list. The Programs list contains the executable programs in your current working directory; see " Changing the Current Working Directory".
Use the Load-Program Filter box to control the display of file names in the Programs list; the box uses standard Solaris filters. For example, you can click on a directory in the Directories list if you want to change to that directory. But the Programs list does not update automatically to show the programs in the new directory. Instead, the filter changes to directory-name/*, indicating that all files in directory-name are to be displayed. Click on Filter to display the file names of the programs. Or simply double-click on the directory name in the Directories list to display the programs in the directory.
If you want to use a different filter, you can edit the Load-Program Filter box directly. For example, change it to directory-name/prog* to display only programs beginning with prog.
Click on Cancel or press the Esc key if you decide not to load a program.
Issue the load command on the command line, with the name of the executable program as its argument. For example,
load myprogram
The program you specify is loaded.
Once a program is successfully loaded:
The program's name appears in the Program field in the main window.
The source file containing the program's main function appears in the source window.
The Load dialog box disappears (if you loaded the program using this box).
The status region displays the message not started.
You can now issue commands to execute and debug this program.
If Prism can't find the source file, it displays a warning message in the command window. Choose the Use selection from the File menu to specify other directories in which Prism is to search; see " Creating a Directory List for Source Files".
You can load only one program at a time. If you have a program loaded and you want to switch to a new program, simply load the new program; the previously loaded program is automatically unloaded. If you want to start fresh with the current program, issue the reload command with no arguments; the currently loaded program is reloaded into Prism.