A P P E N D I X  A

Commands-Only Mode of the Prism Environment

You can run the Prism environment in a commands-only mode, without the graphical interface. This is useful if you don't have access to a terminal or workstation running X. All of the functionality of the Prism environment is available in commands-only mode except features that require graphics (for example, visualizers). See Specifying the Commands-Only Option.

If you are using an X-terminal, you can also run a commands-only mode of the Prism environment that lets you redirect the output of certain commands to X windows. This may be preferable to users who are used to a command-line interface for debugging but want to take advantage of some of the Prism environment's graphical features. See Running the Commands-Only Mode of the Prism Environment From an X-terminal: the -CX Option.

For further information on individual commands, read the sections of the main body of this guide that deal with the commands, and read the reference descriptions in the Prism Reference Manual.

This appendix discusses the following topics:


Specifying the Commands-Only Option

To enter commands-only mode, specify the -C option on the prism command line. You can also include other arguments on the command line; for example, you can specify the name of a program, so that the Prism environment comes up with that program loaded. X toolkit options are, of course, meaningless. See Starting the Prism Environment for more information on command-line options.

When you have issued the command

% prism -C a.out

you receive this prompt:

(prism all)

You can issue most Prism commands at this prompt, except for commands that apply specifically to the graphical interface; these include pushbutton, tearoff, and untearoff.


Issuing Commands

You operate in the commands-only mode of the Prism environment just as you do when issuing commands on the command line in the graphical mode of the Prism environment; output appears below the command you type, instead of in the history region above the command line. You cannot redirect output using the on window syntax. You can, however, redirect output to a file using the @ filename syntax.

The commands-only mode of the Prism environment supports the editing key combinations supported by the graphical mode of the Prism environment, plus some additional combinations. Here is the entire list:

When printing large amounts of output, the commands-only mode of the Prism environment displays a more? prompt after every screen of text. Answer y or simply press the Return key to display another screen; answer n or q, followed by another Return, to stop the display and return to the (prism) prompt.

You can adjust the number of lines the Prism environment displays before issuing the more? prompt by issuing the set command with the $page_size variable that specifies the number of lines you want displayed. For example, issue this command to display 10 lines at a time:

(prism all) set $page_size = 10

Set the $page_size to 0 to turn the feature off; the Prism environment will not display a more? prompt.


Useful Commands

This section describes some commands that are especially useful in the
commands-only mode of the Prism environment.

Use the list command to list source lines from the current file. For example,

(prism all) list 10, 20

prints lines 10 through 20 of the current file.

Use the show events command to print the events list. Use the delete command to delete events from this list.

Use the set command with the $print_width variable to specify the number of items to be printed on a line. The default is 1.


Leaving the Commands-Only Mode of the Prism Environment

Issue the quit command to leave the commands-only mode of the Prism environment and return to your Solaris prompt.


Running the Commands-Only Mode of the Prism Environment From an X-terminal: the -CX Option

Issue the prism command with the -CX option from an Xterm to start up an instance of the commands-only mode of the Prism environment that lets you redirect the output of certain commands to X windows. The information presented earlier in this chapter about the commands-only mode of the Prism environment also applies to this version, except that this version lets you redirect output using the on window syntax.

You can redirect the following output to X windows:

To redirect the output, issue the appropriate command with the on dedicated or on snapshot syntax, just as you would in the graphical mode of the Prism environment. For example, this command displays a visualizer for x in a dedicated window:

(prism all) print x on dedicated

You can specify the type of the visualizer as well, by adding as type after the on window argument. For example:

(prism all) print x on dedicated as colormap

In addition, you can display help windows from within windows that you pop up in this way.