Executing ABS Projects from ABS Eclipse IDE

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.

Java

The Java Backend can be started either by using a run configuration or by pressing a predefined button in the toolbar.

Toolbar buttons:

Button NumberButton tooltipFunctionality /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.

Run configurations:

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.

Main Tab

Options:

ABS Project
The chosen project with an ABS Model.
ABS Product
A product from the selected ABS Model.
Run Target
The start point of the execution. This can be a module with a main block or you can select to run all unit tests in the project.
Draw sequence diagram
If this option is checked, SDEdit will start and a sequence diagram of the execution is drawn.
Scheduler Options Tab

Available Schedulers:

Manual scheduler
With this scheduler the user has to decide which Task to execute first, whenever there is an alternative.
Random scheduler
This scheduler makes random decisions about which Task to execute first. A fixed random can be set in the options.
Replay history
This scheduler replays a previously saved history file. The file can be chosen in the options.

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.

FLI classpath Tab

In this tab you can select a classpath from which foreign classes will be loaded.

Advanced Tab

You should enable the options on this tab only if you know what you are doing.

Options:

Skip compilation before run
If this option is selected, Eclipse will not recompile the ABS sources before the program is executed. The binaries from the last compilation will be used.
Ignore missing foreign classes
If this option is selected, there will be no error when FLI fails to load a foreign class.

Maude

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 and the ABS Debug Perspective

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".

Debug 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.

  • Interactive Scheduler

    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.

  • Random Scheduler

    The random scheduler will select the task to step randomly.

  • History Scheduler (planned)

    The history scheduler allows you to run a history from a file.

Functionality of the buttons under a specific scheduler is as follows:

Action SchedulerInteractiveRandomHistory
Single StepSteps 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 StepsSame 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 OverDoes nothing
Run to LineSteps 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
ResumeSteps 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 history

    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.

  • terminate (not really working so far)

    Terminates the debug process.

Variable View

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.