Skip to content

Overview

Concepts and Principles

Development

Overview

IDEs

API Explorer

Releases

Release Notes

TORO Integrate

Coder Studio

Coder Cloud

Bug Reports

Search

Debugging Gloop Services

When debugging a Gloop service, you gain the ability to manipulate the execution of the service, and the variables the service is using. This includes adding breakpoints, stepping through steps, examining and manipulating the context, performing evaluations and more. In this section, we will go over each of them and learn how they could be used to debug a Gloop service.

Starting a Debug Session

To start a debug session, you need to run your Gloop service in debug mode. When a service is running in debug mode, you will be able to perform debug operations on that service. To do this:

  1. Open the Gloop service.
  2. Right-click on the Step Tree.
  3. Click Debug As > Gloop Service.

Debug A Gloop Service

  1. Open the Gloop service.
  2. Right-click on the Step Tree.
  3. Click Debug.

Debug A Gloop Service

Toggling Breakpoints

Breakpoints are used as markers to suspend the execution of the service. Breakpoints mark a particular step in a Gloop service, when that step is reached the execution will be suspended. Breakpoints have two properties, Hit Count and Condition.

The Hit Count value is used to tell Gloop how many times the breakpoint needs to be hit before it will suspend execution of the service. This can be useful when iterating over arrays. By default the Hit Count is -1, meaning that the first hit will suspend the execution.

The Condition is a Groovy expression which returns either true or false. If the expression returns true the execution will be suspended. If the Condition is empty it has no effect. The current context properties of the step are available in the expression, therefore a property value can be used to determine if a breakpoint should suspend the execution or not.

To toggle a breakpoint:

  1. Select one or multiple steps
  2. Right click the line number ruler on the left of the steps, then click Toggle Step Breakpoint or press Ctrl ⇧ B or ⌘⇧B.

Alternatively, you can also double-click on the line number to toggle a breakpoint.

Toggle breakpoint

To toggle a breakpoint, select one or multiple steps, right click, then click Toggle Step Breakpoint or press Alt ⇧ B.

Toggle breakpoint

Toggling Tracepoints

A tracepoint is simply a breakpoint with a condition expression that prints the service and line number instead of returning true or false. While a service is being debugged with a tracepoint, the tracepoint will log every time the tracepoint has been hit. Since a tracepoint is a breakpoint, you can also change the Condition, or even add logic to use it as both a tracepoint and a breakpoint by having the Condition expression return true.

To toggle a tracepoint, select one or multiple steps right click the line number ruler on the left of the steps, then click Toggle Step Tracepoint or press Ctrl ⇧ T or ⌘⇧T.

Toggle tracepoint

To toggle a tracepoint, select one or multiple steps, right click, then click Toggle Step Tracepoint or press Alt ⇧ T.

Toggle breakpoint

Debugging Step Commands

Similar to debugging in other programming languages, Gloop provides multiple ways of stepping through a service once a breakpoint has been hit, which are described below.

Step Command Description
Resume Resumes the debug execution until a breakpoint is hit or the service is completed.
Pause Suspend the debug execution.
Terminate Stop the debug execution.
Step Into Steps into the Step.
Step Over Steps over the Step unless a breakpoint is hit.
Step Return Resumes until the current service has returned out to the caller when stepped into a service, or the main service has completed.

The Debug Perspective

Coder provides a Gloop-specific Debug perspective, which is pre-configured with all the views and components required to debug a Gloop service. In this perspective you cacn set breakpoints, edit values of variables at runtime, or evaluate expressions and run multiple simultaneous debugging sessions. The screenshots below have been numbered, each with their own section documented below.

Debug Perspective

Debug Perspective

When a service that is being debugged has hit a breakpoint, a prompt to switch to debug perspective will show. Prompt Dialog

Prompt Dialog

1. Debug View

This view shows the debug execution stack of services that are currently being debugged. Selecting a stack will open the service in the service editor, highlighting the line of the service that it's currently waiting on. From here you can choose how to step through the service next, or to terminate it.

Debug View

Debug View

2. Variables View

This view shows the variables and their values for the current chosen execution stack.

The variables will be highlighted when their value changes. Variables View

Variables View

The values can be edited at runtime by right-clicking on a variable and selecting Change Value.

Variables View change values demo

Variables View change values demo

3. Debug Execution History View

This view shows the execution history of the service (up to the last 100 steps) and also shows the time the previous Steps took to execute (which is useful in finding bottlenecks in your Gloop services). The table headers can be clicked on for sorting.

Debug Execution History View sort by Time Execution

Debug Execution History View sort by Time Execution

4. Expressions View

This view allows you to write Groovy expressions which are evaluated with the service that is currently being debugged. Expressions here cannot be used to change the value of variables that are being debugged.

When a variable can't be evaluated, it will display error(s) during the evaluation. Add Expression

Add Expression

Evaluations

The evaluations made while debugging do not alter the values of the context.

5. Breakpoints View

This view lists all the breakpoints across all Integrate instances. Breakpoints can be deleted or disabled by un-checking the checkbox beside them. When selecting a breakpoint the Hit Count and Condition configuration appears below it. When a breakpoint configuration is modified, press Ctrl S or ⌘S to persist the changes.

Breakpoints View

Breakpoints view

Note

The previous conditions entered are accessible in the drop-down box above the text area.

Breakpoints View add breakpoint condition demo

Breakpoints View

From the GIF above, you'll see that the debug execution pauses when the value of sum is 6.6.

Another way to edit breakpoint conditions

You could also edit the breakpoint condition via right-clicking the breakpoint from the Gloop Service Editor and selecting Edit Breakpoint Properties. Breakpoint Properties

You could also edit the breakpoint condition via right-clicking the Step with breakpoint from the Gloop Service Editor and selecting Edit Breakpoint Properties. Breakpoint Properties

Shortcuts

Command Description Shortcut
Toggle Breakpoint Toggles a breakpoint ⌘⇧B or Ctrl ⇧ B
Toggle Tracepoint Toggles a tracepoint ⌘⇧T or Ctrl ⇧ T
Resume Resumes the debug execution until a breakpoint is hit F8
Terminate Stops the debug execution ⌘F2
Step Into Goes into the Step F5
Step Over Goes over the Step until a breakpoint is hit F6
Step Return goes out to the caller when stepped into a service F7

Customise Shortcuts

The shortcuts listed above are the default keyboard shortcuts for TORO Coder Studio, the shortcuts can be be modified by going to the Preferences then selecting the Keys page.

Command Description Shortcut
Toggle Breakpoint Toggles a breakpoint Alt ⇧ B
Toggle Tracepoint Toggles a tracepoint Alt ⇧ T