Debugger : Debugger Commands : SET OBJECT Command

SET OBJECT Command

To change the current value of a condition or a data-item, or to change the current status of an event, use one of the following three forms of the SET command:

Pdb > SET CONDITION condition_name := boolean_expression

 

Pdb > SET DATA_ITEM data_item_name := data_expression

 

Pdb > SET EVENT event_name := event_expression

 

Note that the command is applicable only to primitive objects; you cannot change the value or the status of a compound object.

On the right-hand side of an assignment, you can put any legal Rational Statemate expression whose type corresponds to that of the object on the left-hand side. The value on the right-hand side of the assignment is evaluated, and assigned to the object whose value is being set.

Examples:

Pdb > SET CONDITION c1 := true
Pdb > SET DATA_ITEM int_var := 5*y
Pdb > SET DATA_ITEM str_var := “new string”
Pdb > SET EVENT e1 := e2 or e3

To generate event e independently of other elements’ statuses, type:

Pdb > SET EVENT e := true

or

Pdb > SET EVENT e

To turn off or, reset event e, type:

Pdb > SET EVENT e := false

The SET command does not impose the redefinition of the system’s object. In the example above that sets event e1, the current statuses of e2 and e3 are examined immediately, and if either event is generated, then e1 becomes generated this time only. Later in the run, having e2 or e3 generated does not cause e1 to be generated. Thus, e1 remains primitive and is not redefined by the command as a compound event.

The SET OBJECT command is a very powerful command to use in debugging sessions when you discover an error in the specification, and you want to continue debugging, without first correcting the specification. This command can be combined with the breakpoint operations to temporarily correct mistakes in the specification.

Suppose, for example, that there is a static reaction on entering state S which refers to condition C defined as:

C = (X=1)

 

and the correct definition should have been:

C = (X=1 and Y>0)

 

You can then enter the following:

Pdb > SET BREAK bp entered (s)
DO SET COND c:=(x=1 and y>0); GO END

The prototype then behaves as if the error is fixed, allowing you to concentrate on looking for other problems. Later you should correct the definition of C using the Properties Editor.