IBM
Contents Index Previous Next



Examining the System


In the Simulator, you can issue a number of monitor commands to examine the internal status of the system. Detailed information concerning processes, procedure calls, signals, timers, and variables can be requested. Using the Simulator UI, you may continuously view the internal status by using the Command and Watch windows; see The Command and Watch Windows.

Current Process and Scope

Some of the commands used for examining the system operate on a specific process instance, the current process, identified by the current scope. A scope is a reference to a process instance, a reference to a service instance if the process contains services, and possibly a reference to a procedure instance called from this process/service (the current procedure). The scope is also used by some of the commands for modifying the system; see Modifying the System.

The scope is automatically set by the execution commands, when entering the monitor, to the next process instance in turn to execute. You may change the scope if you would like to examine (or modify) another process, service or procedure instance. Changing the scope does not change the execution order of process instances. As soon as the execution continues again, the scope is reset to the next process instance in turn to execute.

The Process/service Scope

To print the current process/service scope enter the command Scope.

To set the current process/service scope:

  1. Choose Set Scope in the Examine menu, or enter the command Set-Scope. This command takes one parameter, a process instance, and optionally if the process contains services, a second parameter which specifies a service name.
  2. Select or enter the name of a process instance.
  3. If the process instance contains services, select or enter the name of a service instance.

The scope is set to the specified process/service, at the bottom procedure call.

The Procedure Scope

To print the procedure call stack for the process/service instance defined by the current scope, choose Call Stack in the Examine menu, or enter the command Stack.

To change the procedure scope within the current process/service scope, you can move the scope one step up or down in the procedure call stack by entering the command Up or Define-MSC-Trace-Channels. Going up from a service leads to the process containing the service. To go down in a service within a process, select or enter the name of the service instance.

Printing the Simulation Time

To print the current value of the simulation time, in case it is not displayed by the textual trace, choose Now in the Examine menu, or enter the command Now.

Printing the Process Ready Queue

The ready queue is the queue of process instances that are ready to execute a transition, i.e., those instances that have received a signal that can cause an immediate transition, but that have not yet had the opportunity to execute this transition to its end.

To print an ordered list of the process instances in the ready queue, choose Ready Q in the Examine menu, or enter the command List-Ready-Queue. The list contains an entry number (queue position), the process instance, its current state, the number of signals in its input port, and the name of the signal that will cause the next transition. If a process instance has active procedure calls, the current executing procedure instance is also listed. If the state name is followed by a `*', then the process/procedure is currently executing a transition starting from this state.

The ready queue is by default printed in the Command window. It may look like this:

Figure 478 : The ready queue in the Command window

Examining Process Instances

To list all active process instances of a certain process type:

  1. Click the Process List button in the Examine module, or enter the command List-Process. The command takes one parameter, the name of the process type. (The button already has the parameter `-'.)
  2. Select or enter a process type. If no process type is specified, or it is specified as `-', all active process instances in the system are listed. The list contains the same details as described for the process ready queue, above.

To print information about the current process instance, enter the command Examine-PId. The information contains the current values of Parent, Offspring, Sender and a list of all currently active procedure calls made by the process instance (the stack). For more information on current process and procedure call stack, see Current Process and Scope. An example of output is:

Parent    : null
Offspring : Game:1
Sender    : env:1

PId       Main:1

Examining Signal Instances

To list all signal instances in the input port of the current process instance, choose Input Port in the Examine menu, or enter the command List-Input-Port. The list contains an entry number (queue position), the signal type, and the sending process instance. If the entry number is prefixed by a `*', the signal instance is the one to be consumed in the next transition performed by the process instance. For more information on the current process, see Current Process and Scope. An example of output is:

Input port of Game:1
Entry   Signal name          Sender
*1      Bump                 Demon:1
 2      GameOver             Main:1

To print the parameters of a signal instance in the input port of the current process instance:

  1. Choose Signal in the Examine menu, or enter the command Examine-Signal-Instance. This command takes one parameter, an entry number in the input port.
  2. Enter an entry number. To see what entry number is associated with the signal instance, list the input port as described above. An example of output is:
    Signal name : Score
    
    Parameter(s) : -1
    

Examining Timer Instances

To list all active timers in the system, choose Timer List in the Examine menu, or enter the command List-Timer. The list contains an entry number, the timer name, the corresponding process instance, and the associated time. An example of output is:

Entry   Timer name        PId                Time
1       T                 Demon:1            4.0000


To print the parameters of an active timer instance:

  1. Enter the command Examine-Timer-Instance. This command takes one parameter, an entry number in the timer list.
  2. Enter an entry number. To see what entry number is associated with the timer instance, list the active timers as described above. If only one timer is active, the entry number is not needed.

Examining Variables

To print the value of a variable or formal parameter in the current process or procedure:

  1. Click the Var In Scope button in the Examine module, or enter the command Examine-Variable. This command takes two optional parameters, the name of the variable and a specification of a variable component.
  2. Select or enter the name of a variable, possibly abbreviated. If no variable name is specified, all variables and formal parameters of the current process or procedure are printed.
    If a variable has several components (e.g. an array, struct or string) and it is specified without a component, the values of all components of the variable is printed (e.g. the complete array).
    • To print only a certain component, specify the component after the variable name. (In the Simulator UI, this must be done on the text input line in the dialog, after a variable name has been selected.)
    • To get a list of the possible components of a variable, enter a `?' after the variable name. (In the Simulator UI, this must be done on the text input line in the dialog, after a variable name has been selected; another dialog is then opened, in which the component can be selected.)
      More information on the input and output of SDL data types can be found in Input and Output of Data Types.

To examine variables or formal parameters in any process, click the Variable button in the Examine module. In addition to the variable name and component (as described above), you will be prompted for the process name.


http://www.ibm.com/rational
Contents Index Previous Next