IBM
Contents Index Previous Next



More Tracing and Viewing Possibilities


In this exercise, we will take a look at some of the additional tracing and viewing possibilities of the SDL Explorer.

What You Will Learn

Using the View Commands

  1. Make sure you are still in the same state as after the last step in the previous exercise.
    To see a complete printed trace from the start state to the current state, you can use the Print-Trace command. As parameter, it takes the number of levels back to print the trace from.
  2. On the input line of the Explorer UI, enter the command pr-tr 9 (you can use any large number). The trace is printed in the text area of the main window. This trace gives an overview of what has happened in the SDL system so far.
  3. The SDL Explorer supports the same viewing possibilities as the SDL Simulator. Click the Timer List button in the View module to list the active timer set by the Demon process.
  4. Examine the GameP variable in the Main process by first setting the scope to the Main process (click the Set Scope button and select the Main process), and then clicking the Variable button and selecting the GameP variable.
    • You may also use the Watch window in the explorer to continuously monitor the values of variables.

Using MSC Trace

In addition to textual and graphical traces, the SDL Explorer can also perform an MSC trace.

  1. First, turn off SDL trace by selecting Toggle SDL Trace from the Commands menu. Then, turn on MSC trace from the same menu. An MSC Editor is opened, showing a Message Sequence Chart for the trace from the start state to the current state.
    • You may also close down the SDL Editor to avoid having too many windows on-screen.

Figure 134 : The current MSC trace

  1. When the MSC appears, execute, with a double-click, one of the signal transitions in the Navigator, e.g. Probe. The message is appended to the MSC (but it is not yet consumed).
  2. Go up a few levels in the Navigator.
    Note how the selection in the MSC Editor changes to reflect the MSC event corresponding to the current state!
  3. Go down again, but select a different path than before, i.e., send one of the other signals.
    Note how the MSC diagram is redrawn to show the new behavior of the system!
  4. Toggle MSC trace off in the Commands menu. Unless other MSC diagrams were opened, the MSC Editor is closed.

Going to a State Using Path Commands

You can use the commands Print-Path and Goto-Path to return to a state where you have been before.

  1. Execute the command Print-Path from the input line. The output represents the path taken in the behavior tree from the start state to the current state.
    Command : print-path
    
    1 1 1 1 1 3 0
    
    • The numbers in the path are the same as the transition numbers in the Navigator, and the arrow numbers shown in Figure 133.
  2. Go up a few levels in the Navigator.
  3. In the text area, locate the path printed by the Print-Path command above (you may have to scroll the text area). On UNIX, select the numbers in the path with the mouse by dragging the mouse to the end of the line. Make sure you select the final zero.
  4. In the input line, enter goto-path and the path printed by the Print-Path command. On UNIX, paste in the path numbers by positioning the mouse pointer at the end of the entered text and clicking the middle mouse button.
  5. Hit <Return> to execute the command. You now end up in the previous state.
    • If you make an error while entering the path numbers, you can clear the input line by using the <Down> arrow key and try again.

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