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:
This code lives in "scripts/controller.lua", lines 233-241:
Pressing F7 should step the debugger to this function. The execution actually does so, however, vscode shows this:
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:
(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).
[2.1.17] Debugger does not load correct source file when stepping
[2.1.17] Debugger does not load correct source file when stepping
- Attachments
-
- dap-trace.log
- (2.31 MiB) Downloaded 6 times
-
justarandomgeek
- Filter Inserter

- Posts: 332
- Joined: Fri Mar 18, 2016 4:34 pm
- Contact:
Re: [2.1.17] Debugger does not load correct source file when stepping
the trace you have provided does not seem to match these over-cropped screenshots (at no point does it include a stack trace for any of the shown function names), and there is not enough information to attempt to recreate the issue.
Re: [2.1.17] Debugger does not load correct source file when stepping
Tell me what you need and I can provide it. I can do a full screen video if needed. It is one of two issues I have with FMTK right now.
The log is from the session where I took the screenshots. If you say it does not match, maybe that is the problem.
The log is from the session where I took the screenshots. If you say it does not match, maybe that is the problem.
Re: [2.1.17] Debugger does not load correct source file when stepping
Factorio 2.1.17
FMTK 2.1.9
VSCode 1.136.1
- clone https://github.com/hgschmie/factorio-mi ... -redux.git into "miniloader-redux" in your mod folder. Checkout the 2.2.1 tag
- open the mod code in vscode.
- put a breakpoint on line 178 in scripts/event-setup.lua
- create a new game under the debugger. Only base game mod and miniloader-redux (should show as version 2.2.1) mod
- use sandbox mode. click yes to all modal questions
- craft a new blue miniloader
- place the miniloader
- create a blueprint from the miniloader
- this should hit the breakpoint at line 178. This is where the video starts.
The attached dap-trace.log is from the exact session in the video.
FMTK 2.1.9
VSCode 1.136.1
- clone https://github.com/hgschmie/factorio-mi ... -redux.git into "miniloader-redux" in your mod folder. Checkout the 2.2.1 tag
- open the mod code in vscode.
- put a breakpoint on line 178 in scripts/event-setup.lua
- create a new game under the debugger. Only base game mod and miniloader-redux (should show as version 2.2.1) mod
- use sandbox mode. click yes to all modal questions
- craft a new blue miniloader
- place the miniloader
- create a blueprint from the miniloader
- this should hit the breakpoint at line 178. This is where the video starts.
The attached dap-trace.log is from the exact session in the video.
- Attachments
-
- Screen Recording 2026-09-05 at 14.18.29.mp4
- (8.4 MiB) Downloaded 4 times
-
- dap-trace.log
- (394.03 KiB) Downloaded 2 times
-
justarandomgeek
- Filter Inserter

- Posts: 332
- Joined: Fri Mar 18, 2016 4:34 pm
- Contact:
Re: [2.1.17] Debugger does not load correct source file when stepping
okay, i've replicated it now, investigating...
-
justarandomgeek
- Filter Inserter

- Posts: 332
- Joined: Fri Mar 18, 2016 4:34 pm
- Contact:
Re: [2.1.17] Debugger does not load correct source file when stepping
it looks like this is specifically an issue with tailcalls (of metamethods? not sure yet...), so as a workaround for now, putting parens around the return makes it step to the correct location:
Code: Select all
return (This.MiniLoader:serializeConfiguration(entity))-
justarandomgeek
- Filter Inserter

- Posts: 332
- Joined: Fri Mar 18, 2016 4:34 pm
- Contact:
Re: [2.1.17] Debugger does not load correct source file when stepping
DebugAdapter was incorrectly holding cached information about the caller function after the tailcall hook, when the callee got moved up into that slot (and thus now matches by address), and only refreshing the line number, thus leading to the incorrect "merged" stack report with the callee's line number in the caller's file.
