4.6 Debugging

A run halts at the breakpoints of its state machines when the project has the language feature Breakpoints switched on. The debugger then shows where the run halts and lets it go on, a breakpoint or a tick at a time.

4.6.1 Switching breakpoints on#

Choose Run > Language Features > Switch On Breakpoints. The project file gets the line feature.breakpoints = on, see 4.1.7 Language features. While the feature is off, every BREAKPOINT block is an error that blocks the run, and a run has no debugger.

With the feature on, the run switches on the runtime feature Breakpoint, see 3.2 Runtime features.

4.6.2 Setting breakpoints#

A breakpoint is a block of the text, see 2.3.9 Breakpoints. In a state, BREAKPOINT { ENTRY EXIT } halts before the state is entered, before it is left, or both. In a transition, split or join, BREAKPOINT { START END } halts before the transition changes the active states, after it, or both.

STATEMACHINE ATTACHED TO "Lamp" {
    STATES {
        INITIAL STATE "off" {
            BREAKPOINT { EXIT }
        }
        STATE "on" { }
    }
    TRANSITIONS {
        TRANSITION "off" -> "on" {
            BREAKPOINT { START }
            CONDITION { EVENT("switch", "press") }
        }
    }
}

In a statechart, the menu of a state has Add breakpoint at entry and Add breakpoint at exit, and the menu of a transition has Add breakpoint at start and Add breakpoint at end. Each has a Remove entry once the breakpoint is set, see 4.3.4 Editing a statechart. A breakpoint shows as a dot in the error colour: on the left border of a state for its entry, on the right border for its exit, in front of the caption of a transition for its start and behind it for its end.

4.6.3 The debugger line#

A run with breakpoints switched on has a third line in the Runtime tool window, below the list of runs. It starts with Debugger.

The line readsButtonsMeaning
RunningPauseThe run goes on.
Paused before the entry of on in lamp, Paused before the exit of off in lampResume, StepThe run halts at a breakpoint of a state. The line ends with the key of the object whose instance halted.
Paused before the transition off to on in lamp, Paused after the transition off to on in lampResume, StepThe run halts at a breakpoint of a transition. The states of a split or join are joined by and.
Paused between two ticksResume, StepThe run halts after a Pause or after a Step that ended its tick.
CommandKeyEffect
PausenoneThe run finishes the tick it is in and then waits.
ResumeF9The run goes on up to the next breakpoint.
StepF8The run goes on to the next breakpoint or to the end of the tick, whichever comes first. From between two ticks it runs one tick.

Pause, Resume and Step are also in the Run menu. They act on the selected run.

4.6.4 What a pause shows#

While a run is paused, the open statechart of the state machine marks the place in the warning colour: a dashed frame around the state, or the lines of the transition drawn wide with a dashed frame around its caption and its bar, see 4.3.10 While a model runs. The debugger line names the place in words.

4.6.5 Breakpoints of definitions#

A breakpoint in an attachable state machine halts every instance of it, since each object that runs the definition runs the same text, see 4.5.4.7 State machine instances. The debugger line names the object whose instance halted, as in Paused before the entry of lit in gen_Bulb_0, and the statechart of the definition shows that instance while the run is paused, whichever instance was chosen before. The runtime forgets what an instance left behind when it ends, so a later instance on the same object starts without it, see 3.1.13.3 When instances join and leave.

4.6.6 Breakpoints in pages#

A breakpoint in a fragment halts every use of it, since each container state that uses the fragment runs a copy of its text, see 4.5.4.8 Pages. The debugger line names the state by its name in the flat state machine, as in Paused before the entry of self test/wiring/measuring in lamp. The statechart of the fragment shows the use that halted, with the place marked under the name the fragment gives it, see 4.3.10 While a model runs.

4.6.7 Limits#

  • A run without a window has no debugger. Its breakpoints never halt it, see 4.8 Command line.
  • Pause has no key.
  • A breakpoint takes effect with the next run, because it is part of the uploaded text.

Source: this page on GitHub at commit 3b6029f, refreshed 16 November 2026. The whole reference as a PDF.