The ABS Eclipse IDE currently offers two backends: Java and Maude. In the following, we will explain how ABS projects can be compiled and executed in the respective languages.
The Java Backend can be started either by using a run configuration or by pressing a predefined button in the toolbar.
|Button Number||Button tooltip||Functionality /Description|
|1||"Generate Java Code"||ABS files -> Java & Class files Compiles the ABS Model from selected file's project into Java|
|2||"Debug Model (Java)"||Opens debug perspective with default observer and scheduler.|
|3||"Start SDEdit (Java)"||Like button 2, but in addition an UML observer and SDEdit will be used /started.|
The user can create, manage and run different run configurations. Run configurations can be found in the Run menu of the menubar (Run -> Run Configurations) as well as in the right-click menu of ABS projects or files.
The Run automatically option can be enabled for the random and replay scheduler. This has the same effect as pressing the run-button in the debugger.
You should enable the options on this tab only if you know what you are doing.
In contrast to the Java execution, Maude can not directly be run by the plug-in. Instead, Maude has to be installed separately and the User is required to configure the Maude path accordingly. This can be done under Window -> Preferences -> ABS -> ABS Maude Preferences (If you try to run Maude without configuring this path, the preference dialog will pop up anyway). For Linux and Mac OS you can find the maude executables at the site of the University of Illinois at Urbana-Champaign (http://maude.cs.uiuc.edu/download/). Windows users may use Maude for Windows provided by the Moment project (http://moment.dsic.upv.es/).
Two Buttons are provided for Maude: compiling and executing.
Compile will generate a .maude file named after the project in a project specific folder (default is gen/maude). This folder can be changed in the project properties (right click on project in the package explorer -> properties -> ABS -> Maude Backend). In Addition, the abs-interpreter.maude is copied in that directory.
Execute will do the same, but will also run Maude afterwards with the generated code. The output of Maude will be printed in a console. If Maude completed successfully, the output will be printed as info (black), otherwise as error (red).
Note, that the Maude backend can only handle one main block. Compiling a project with multiple main blocks will lead to unspecified behaviour. Since a complete project is compiled into one .maude file, this consequently leads to the restriction of one main block per project.
In addition to the described buttons, the Eclipse plug-in offers run configurations for Maude executions. Those offer more detailed options for running and stroing these configurations for further usage.
Debugging Java with the given buttons (or specific run configurations) will result in opening the ABS Debug Perspective and allows you to debug your program with the internal debugger of the ABS Eclipse plug-in.
The Debug Perspective provides two new views, the debug view and the variable view. If you close these views by accident, you can reopen them under "window -> show view".
With the help of the debug view you can, you can control your debug process. It contains a tree of COGs, tasks, stack frames and objects representing the state of your program. It also contains a set of buttons, allowing you to step single tasks.
The plug-in currently provides two schedulers, which determine which task to step next. A third scheduler is planned. The scheduler can be selected with the "Choose scheduler" button in the debug view.
The interactive scheduler allows you to select the task you want to step by selecting the task (or a stack frame of the task) in the debug view tree.
The random scheduler will select the task to step randomly.
The history scheduler allows you to run a history from a file.
Functionality of the buttons under a specific scheduler is as follows:
|Single Step||Steps the task currently selected in the debug view tree (or, if a stack frame is selected, the task with that stack frame).||Steps a randomly selected task once.||Makes the next step from the history.|
|N Steps||Same as single step but does multiple steps on this task. If the task terminates or suspends before being stepped n times, no further steps will be done.||Makes n random steps (step a randomly selected task, step another randomly selected task, ...).||Makes the next n steps from the history.|
|Step Over||Does nothing|
|Run to Line||Steps the currently selected task until a given line will be reached. If the line is never reached, the task runs until it finishes or has to wait for another task to continue.||Makes random steps until a given line is reached by any task. If it is never reached, steps are done until the program terminates.||Does nothing|
|Resume||Steps the currently selected task until it finishes or suspends.||Makes random steps until the program is terminated.||Makes all remaining steps contained in the history.|
Two more buttons are contained in the debug view.
Save the sequence of taken steps in a file, allowing you to re-execute this run at a later point in time, e.g. after you fixed a bug in your abs sources.
Terminates the debug process.
The variable view allows you to inspect stack frames and objects of your program. If a stack frame or an object is selected, the variable view is refreshed an shows the values of the selected stack frame or object in a tree. If the program makes a step, the current stack frame of the stepped task is loaded to the variable view.