-
Notifications
You must be signed in to change notification settings - Fork 0
F# computation expression breakpoints don't fire in DAP mode #9
Copy link
Copy link
Closed
Description
Problem
Line breakpoints inside Expecto test "name" { ... } computation expression blocks never fire when debugging via DAP (Debug Adapter Protocol). This affects both Microsoft's vsdbg and Samsung's netcoredbg.
Breakpoints show as verified (solid red in VS Code) but the debugger never stops. Breakpoints in regular F# functions and Program.fs work fine — only CE bodies are affected.
Root cause
The F# compiler transforms CE bodies into closure classes (e.g., simTests@20-3.Invoke()). The DAP setBreakpoints protocol can't resolve source lines to the generated IL sequence points in these closure classes.
What works
- netcoredbg CLI mode:
break SimTests.fs:22works when set after modules are loaded (two-stage approach). The CLIbreakcommand uses a different internal resolution path than DAPsetBreakpoints. - Function breakpoints: Auto function breakpoint on
Verifrog.Sim.Sim.ReadOrFailfires on virtually any test that reads a signal. - Non-CE code: Breakpoints in regular F# functions,
Program.fs, etc. work fine with both debuggers.
What doesn't work
justMyCode: false— no effect- Re-sending
setBreakpointsafter entry stop — returnsverified: truebut still doesn't fire - Toggling breakpoints off/on — no effect
stopAtEntry+ re-resolve — no effect
Possible fix paths
- Custom DAP proxy — Translate incoming
setBreakpointsrequests into netcoredbg CLI-stylebreakcommands after module load. This would work around the DAP protocol limitation without waiting for upstream fixes. - Upstream netcoredbg fix — File issue with Samsung/netcoredbg for F# CE breakpoint support in DAP mode.
- Upstream vsdbg fix — File issue with Microsoft, though vsdbg is closed-source and less likely to get F#-specific fixes.
Context
Discovered during Track 06 (debug integration). Full investigation notes in conductor/projects/v1_release/tracks/06_debug_integration/plan.md.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels