The command syntax described in " Defining Psets" lets you apply a command to a specific pset. If you don't use this syntax, the command is applied to the current pset; current is a predefined pset name in Prism. In addition, many graphical actions in MP Prism apply only to the members of the current set.
When a program is first loaded, the current pset is the default pset, all.
You can change the current pset via the Psets window or from the command line.
From the Psets window - There are several ways of changing the current pset via the Psets window:
If the set is displayed in the Psets window, simply double-click anywhere in its display (for example, on its name, or in the box beneath its name).
Choose the Set Pset selection from the Options menu. This displays a list of psets. Click on the name of the set you want to be current.
Edit the name of the pset in the box below Current Set at the top right of the Psets window, then press Return.
When you change the current set, the new name appears in the Current Set box in the Psets window, and the current set shown at the top left of the psets area changes to reflect the contents of the new set.
pset foo
changes the current pset to foo.
You can also use the pset command with the pset-specification syntax described in " Defining Psets". For example,
pset 0:15:3
You cannot change the current pset to one that has no members. If you try to do so, nothing happens in the Psets window, and you get a message like this one in the history region of the command window:
Cannot set current pset to running -- it is empty.
MP Prism provides many ways of finding out the current pset:
As described in the previous section, the name of the current pset appears in the Current Set box at the top right of the Psets window.
The name of the current pset appears in the status region in MP Prism's main window.
The (prism) prompt on the command line and in commands-only MP Prism identifies the current pset. For example, Prism's response to the pset command in the previous section would look like this:
(prism all) pset foo (prism foo)
In giving examples of MP Prism commands, the (prism) prompt is used only when necessary to show the effect of a command.
To list the processes in the current pset, issue the show pset command without arguments:
(prism foo) show pset pset 'current' is defined as 'foo'. The set contains the following processes: 1,2.
The Psets window also displays the processes in the current pset.
" Predefined Psets" described dynamic psets--predefined sets like running, stopped, and interrupted, whose contents Prism automatically updates during the execution of the program.
If you choose a dynamic pset to be the current pset, you create a static pset that consists of the processes that are members of the dynamic set at the time you issue the pset command (or otherwise choose it to be the current set). To make this clear, the (prism) prompt changes to list the processes that are members of this static set. For example, if processes 0, 1, and 13 are the only processes that are stopped, the pset command has this effect:
(prism all) pset stopped (prism 0:1, 13)
Output of the show pset command is explicit under these circumstances:
(prism all) pset stopped (prism 0:1. 13) show pset The current set was created by evaluating the pset 'stopped' once at the time when it became the current set. The set contains the following processes: 0:1, 13.
Issuing the pset command with no arguments displays the same information.
Note that the (prism) prompt can become quite long if there are many processes in a current pset derived from a dynamic pset. By default, the prompt length is limited to 25 characters. You can change this default by issuing the set command with the $prompt_length variable, specifying the maximum number of characters to appear in the pset part of the prompt. For example, this command shortens the prompt long_pset_name to long_pset:
(prism long_pset_name) set $prompt_length=9 (prism long_pset)
" Defining Psets" describes how to create variable psets--user-defined psets whose membership can change in the course of program execution. You use the eval pset command to update the membership of a variable pset. If you make a variable pset your current set, its membership is determined by the most recent eval pset command you have executed for the set. If you have not executed an eval pset command to update the set's membership, the membership continues to be what it was when you created the set.