[2.1.20] Debugger jumps forward when changing breakpoints
Posted: Wed Sep 30, 2026 7:24 pm
When debugging code, sometimes execution jumps forward while adding or removing breakpoints. The behavior is not deterministic, I seen it most with breakpoints in early runtime stage (on_init, on_load, on_configuration_changed).
attached is a video, game log and dap log from a session where this happened.
How to reproduce:
- clone the https://github.com/hgschmie/factorio-el ... ocomotives mod into the mods folder. Check out tag 2.1.1 (not sure that this is relevant but that I what I used to provoke the problem)
- select only the base game, electric-locomotives and EditorExtensions (https://mods.factorio.com/mod/EditorExtensions). This may bring in a library dependency.
- reload the game. This is important so that when loading the map, all mods are already present.
- put breakpoints on line 119 and 140 of control.lua in electric-locomotives
- start the game under the debugger and open the attached map. It will ask for "sync and load" or "load". Do NOT DO "sync and load". Just "load". This ensures that the on_configuration_changed handler is executed
- This should hit the first breakpoint on line 119.
The problem is that this is not wholly deterministic. Sometimes, it is enough now to toggle the breakpoint on line 140 to see the jumping. Sometimes, it requires a single "step over" (F8) or two and the toggling the breakpoint. But I can pretty reliably provoke the behavior in the video by doing so.
attached is a video, game log and dap log from a session where this happened.
How to reproduce:
- clone the https://github.com/hgschmie/factorio-el ... ocomotives mod into the mods folder. Check out tag 2.1.1 (not sure that this is relevant but that I what I used to provoke the problem)
- select only the base game, electric-locomotives and EditorExtensions (https://mods.factorio.com/mod/EditorExtensions). This may bring in a library dependency.
- reload the game. This is important so that when loading the map, all mods are already present.
- put breakpoints on line 119 and 140 of control.lua in electric-locomotives
- start the game under the debugger and open the attached map. It will ask for "sync and load" or "load". Do NOT DO "sync and load". Just "load". This ensures that the on_configuration_changed handler is executed
- This should hit the first breakpoint on line 119.
The problem is that this is not wholly deterministic. Sometimes, it is enough now to toggle the breakpoint on line 140 to see the jumping. Sometimes, it requires a single "step over" (F8) or two and the toggling the breakpoint. But I can pretty reliably provoke the behavior in the video by doing so.