Page 1 of 1

[2.1.17] Debugger does not load correct source file when stepping

Posted: Sat Sep 05, 2026 7:21 am
by hgschmie
FMTK 2.1.9

Stepping (using F7) through a mod. After receiving a `on_pre_player_mined_item` event, the debugger stops on this breakpoint:
Screenshot 2026-09-04 at 23.59.46.png
Screenshot 2026-09-04 at 23.59.46.png (86.54 KiB) Viewed 40 times
This code lives in "scripts/controller.lua", lines 233-241:
Screenshot 2026-09-05 at 00.00.06.png
Screenshot 2026-09-05 at 00.00.06.png (104.8 KiB) Viewed 40 times
Pressing F7 should step the debugger to this function. The execution actually does so, however, vscode shows this:
Screenshot 2026-09-05 at 00.00.14.png
Screenshot 2026-09-05 at 00.00.14.png (72.12 KiB) Viewed 40 times
which is line 234 (correct!) but not in scripts/controller.lua but in "scripts/event-setup.lua" (which is the same file that "serialize_config" is in)

Stepping through the code using F7 gets the debugger to the end of the function correctly while showing the wrong source file:
Screenshot 2026-09-05 at 00.00.35.png
Screenshot 2026-09-05 at 00.00.35.png (86.43 KiB) Viewed 40 times
(this is line 240 in scripts/event-setup.lua, not line 240 in scripts/controller.lua, which is the code that the debugger has executed)

Pressing F7 here returns correctly.

dap trace log attached. The relevant parts start around ""seq":6932" (line 6961).