Chapter 5. Debugging

Since v0.1.0 Kermeta has a debugger. As any debugger, it proposes breakpoints step over, step into, run, resume, visualization of variables, etc

5.1. Global View

A debugger offers users the possibility to interpret Kermeta's programs step by step, or stopping programs at one moment to check the the programs' state. Above you can see the global view of the editor.

The Debugger global view

Figure 5.1. The Debugger global view


5.2. The Watch View

During programs execution, you may want to know variables' values. For that purpose, you can use the watch view which displays all the variables accessible in the current context and their values. Moreover you can browse those variables to have a deeper look inside variables.

The Watch View

Figure 5.2. The Watch View


5.3. The Frame View

A frame is a context environment for a call method. That means that for each method call, you have access to its context that is to say the variables values. Obviously, it is strongly related to the watch view. Clicking on one frame modifies the watch view. The frame view is also nice to follow the execution. For instance, in the figure above, we know that the run method has called the step method which has called the fire method.

The Frame View

Figure 5.3. The Frame View


5.4. The Editor View

When debugging, you surely want to know which line of code is executed. That is the reason why the Kermeta text editor is displayed with the outline. The current line of code is colored in green as in the following figure. This green line is moving to the next instruction depending your action.

The Editor View

Figure 5.4. The Editor View


5.5. Debugging actions

There are three kind of actions you can execute:

  • F5 : pressing the F5 key makes the debugger entering in the current operation.

  • F6 : pressing the F6 key makes the debugger stepping to the next operation.

  • F8 : pressing the F8 key makes the debugger executing all the operations to the next breakpoint, if there is some one.

[Note]Note

A nice feature is that you can add or remove breakpoints to your Kermeta file during debugging.