How to debug

From WeizmannWiki
Revision as of 12:11, 27 November 2012 by Smadar (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Debugging is by default enabled whenever you play out. To disable/enable debugging, check the corresponding flag in the 'Play-Out' properties by right-clicking your project and choosing properties-->PlayGo-->Play-Out-->General tab-->Debug flag:

Playout.properties.general.jpg
When playing-out you can see information about the LSC execution in the 'Play-Out' view, and you can set breakpoints directly on the LSC diagram or in the Java code.

Play-Out View

PlayoutView.jpg
The Play-Out view displays the information logged at runtime by the Tracer. Each line represents an explicit or implicit event that occurred during execution. The information is grouped by events. The icon at the beginning of each line defines the type of information it provides:
Event.gif - information about the event that occurred in the system and triggered the steps included in this sub tree. Contains the event signature.
Cut.gif - information about the cut change. Includes the name of the LSC, the sequence of locations that constitute the current cut, and whether the cut is hot or cold.
Binding.gif - information about a binding of a lifeline. Includes the type of lifeline and the name of the bounded instance.
Completion.gif - information about LSC completion/finish.
ViolationHot.gif - information about a hot violation.
ViolationCold.gif - information about a cold violation.

Upon clicking an entry in the view, a graphical indication is displayed on the diagram. For example, when clicking a 'cut change' entry, the cut is drawn on the diagram. PlayoutView.cutChange.jpg

The information provided in the play-out view can be filtered using the filters provided in the view's toolbar:
PlayoutView.filters.png

Applying breakpoints

Breakpoints can be applied at runtime on the diagram, as well as in the Java code.

On the diagram, set a breakpoint by right-clicking a message and choosing 'Toggle Breakpoint':

LSCEditor.breakpoint.png


Applying a breakpoint in the Java code is done in the standard way (e.g., right-clicking the left-hand side-bar of a source line and choosing 'Toggle Breakpoint').

In both cases, the execution will stop when reaching a breakpoint. Once stopped, it can be resumed by clicking the resume button in the toolbar of the Debug view: DebugView.jpg