![]() |
![]() |
![]() |
![]() |
![]() |
Managing Breakpoints
By setting breakpoints in the system, the execution of a simulator can be stopped and the monitor system activated at a certain point of interest. They can be used to trap certain SDL symbols, transitions, signal outputs, and variable changes.
Breakpoints are often used together with continuous execution to reach a certain state of the system (see Continuous Execution). The monitor system becomes active when the breakpoint condition becomes true. Care should be taken when using continuous execution with breakpoints; if the breakpoint is never reached, the system may continue executing "forever."
Breakpoint Commands
When defining a breakpoint, you may specify one or more monitor commands to be executed after the breakpoint has been reached. In this way it is possible to, for instance, automatically print information about the system by using the examine commands. The monitor commands are specified using the same syntax as when entering them textually.
If you want to use several monitor commands, they have to be separated by spaces and semicolons. It is even possible to use the execution commands in this context to automatically continue the execution after a breakpoint has been reached. However, care should be taken to make sure the system does not end up executing "forever." An example of a combination of breakpoint commands may be:
Examine-PId ; GoSetting a Symbol Breakpoint
Symbol breakpoints are set on a specific SDL symbol. Symbol breakpoints are checked before a symbol is executed, i.e., the symbol is not executed when the breakpoint is reached.
There are two ways to set a symbol breakpoint, either graphically by selecting the SDL symbol directly in the SDL Editor, or textually by specifying an SDT reference to the SDL symbol.
When a symbol breakpoint has been set, the breakpoint is indicated by a red "stop" sign placed at the SDL symbol in the SDL diagram.
To set a symbol breakpoint graphically using the SDL Editor:
- If necessary, open an SDL Editor on the diagram containing the SDL symbol.
- Choose Connect sdle in the Breakpoint menu in the Simulator UI, or enter the command Connect-To-Editor. A new menu Breakpoints now appear in the SDL Editor.
- Select the symbol in the SDL Editor.
- From the Breakpoints menu in the SDL Editor, choose one of the two Set Breakpoint commands. The first command opens a dialog to allow entering one or more optional breakpoint commands. The second command sets the breakpoint without any breakpoint command.
To set a symbol breakpoint textually using an SDT reference:
- Choose Symbol in the Breakpoint menu, or enter the command Breakpoint-At. This command takes two parameters, a textual SDT reference to the SDL symbol and an optional breakpoint command.
Setting a Transition Breakpoint
Transition breakpoints are set on a transition, i.e. the combination of a process instance, state, signal and sender. Transition breakpoints are checked before a transition is executed, i.e., the transition is not executed when the breakpoint is reached.
To set a transition breakpoint:
- Choose Transition in the Breakpoint menu, or enter the command Breakpoint-Transition. This command takes the following parameters: the process name and instance number, the name of a service, the state of the process/service, the signal, the sender's process name and instance number, a breakpoint counter, and an optional breakpoint command.
- Select or enter the name of the process in which the transition exists. If no process is specified, any process will match.
- Enter the instance number of the process. If no instance number is specified, any instance of the process specified above will match.
- Select or enter the name of the service of interest.
- Select or enter the state of the process where the transition is executed from. If no state is specified, any state will match.
- Select or enter the name of the signal that causes the transition. If no signal is specified, any signal will match.
- Select or enter the name of the process sending the signal. If no process is specified, any sender process will match. Note that "env" may be entered for the environment process.
- Enter the instance number of the sender process. If no instance number is specified, any instance of the process specified above will match.
- Enter a breakpoint counter, i.e. how many times the breakpoint condition must be true before the execution is stopped. If no counter value is specified, the default value 1 is used.
- Enter one or more optional breakpoint commands.
Setting an Output Breakpoint
Output breakpoints are set on a signal output, i.e. the combination of a signal, sender process and receiver process. Output breakpoints are checked immediately after a signal is sent.
- Choose Output in the Breakpoint menu, or enter the command Breakpoint-Output. This command takes the following parameters: the signal name, the sender's process name and instance number, the receiver's process name and instance number, a breakpoint counter, and an optional breakpoint command.
- Select or enter the name of the signal. If no signal is specified, any signal will match.
- Select or enter the name of the process sending the signal. If no process is specified, any sender process will match. Note that "env" may be entered for the environment process.
- Enter the instance number of the sender process. If no instance number is specified, any instance of the process specified above will match.
- Select or enter the name of the process receiving the signal. If no process is specified, any receiver process will match. Note that "env" may be entered for the environment process.
- Enter the instance number of the receiver process. If no instance number is specified, any instance of the process specified above will match.
- Enter a breakpoint counter, i.e. how many times the breakpoint condition must be true before the execution is stopped. If no counter value is specified, the default value 1 is used.
- Enter one or more optional breakpoint commands.
Setting a Variable Breakpoint
Variable breakpoints are set on a specific variable and are triggered whenever the value of the variable is changed. Variable breakpoints are checked after a variable assignment, i.e., the execution stops immediately after the symbol or assignment statement where the value was changed.
To set a breakpoint on a variable in the current process:
- Choose Variable in the Breakpoint menu, or enter the command Breakpoint-Variable. This command takes two parameters: the variable name and an optional breakpoint command.
- Select or enter a variable name in the current process.
- Enter one or more optional breakpoint commands.
Listing and Removing Breakpoints
To list all defined breakpoints, choose List in the Breakpoint menu, or enter the command List-Breakpoints. The list contains an entry number and the break condition for each breakpoint, i.e. the values of the parameters specified when the breakpoint was defined. An omitted parameter value, where permitted, is listed as "any."
A symbol breakpoint can be visualized by opening the SDL diagram and selecting the SDL symbol in an SDL Editor. To see where a specific symbol breakpoint has been defined:
- Enter the command Show-Breakpoint (this command has no associated button or menu choice). This command takes one parameter, an entry number in the breakpoint list.
- Enter an entry number. (To see what entry number is associated with the symbol breakpoint, list the breakpoints as described above.) The SDL symbol, pointed out by the SDT reference specified for the breakpoint, becomes selected in an SDL Editor.
To remove a defined breakpoint using the Simulator UI:
- Choose Remove in the Breakpoint menu, or enter the command Remove-All-Breakpoints. This command takes one parameter, an entry number in the breakpoint list.
- Enter an entry number. (To see what entry number is associated with the symbol breakpoint, list the breakpoints as described above.) The breakpoint is removed.
To remove all symbol breakpoints set on an SDL symbol:
- If necessary, open an SDL Editor on the diagram containing the SDL symbol.
- If the Breakpoints menu is not visible in the SDL Editor menu bar, choose Connect sdle in the Breakpoint menu in the Simulator UI, or enter the command Connect-To-Editor. The menu Breakpoints now appear in the SDL Editor.
- Select a symbol with a red breakpoint symbol in the SDL Editor.
- From the Breakpoints menu in the SDL Editor, choose the Remove Breakpoint command. All symbol breakpoints are removed.
To remove all defined breakpoints:
- Enter the command Remove-All-Breakpoints (this command has no associated button or menu choice). All defined breakpoints are now removed.
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |