vsintegration-ide-debugging

Diagnose F# debugging issues involving breakpoints, PDB files, and sequence points.

4.3k|872|Updated Jan 10, 2015
One-click install
npx skills add https://github.com/dotnet/fsharp --skill vsintegration-ide-debugging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vsintegration-ide-debugging
Source: https://github.com/dotnet/fsharp/tree/main/.github/skills/vsintegration-ide-debugging
Command: npx skills add https://github.com/dotnet/fsharp --skill vsintegration-ide-debugging

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

F# developers hit breakpoints that never bind, missing sequence points, or incorrect .pdb output when debugging compiled code. This Skill guides you through building the F# compiler, running Visual Studio integration tests, and inspecting IL/PDB output to fix these debugging issues at the compiler level.

Core Features & Use Cases

  • Build and Test Workflow: Build the compiler with Build.cmd -c Debug and run xUnit2 VS Extensibility integration tests via the xunit console runner (not dotnet test).
  • IL/PDB Inspection: Locate sequence point emission in IlxGen.fs, PDB writing in ilwritepdb.fs, and collection lowering in LowerComputedCollections.fs.
  • Use Case: A breakpoint in a seq expression never binds in Visual Studio. Use this Skill to inspect the generated IL, find that the sequence point sits at a non-stack-empty offset, and move the debug point in IlxGen.fs rather than adding runtime instructions.

Quick Start

Ask the assistant to investigate why an F# breakpoint is not binding and have it build the compiler, run the VS integration tests, and inspect the IL sequence points.

Frequently Asked Questions about vsintegration-ide-debugging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run F# Visual Studio integration tests?

Run the FSharp.Editor.IntegrationTests with the xunit.console.exe runner targeting net472, not `dotnet test`. Locate the runner under the NuGet packages folder and execute the built test assembly with `-parallel none`.

Why does my F# breakpoint not bind in Visual Studio?

The VS debugger binds breakpoints only at stack-empty IL offsets. If the sequence point lands on a non-stack-empty offset, the breakpoint will not bind, so the fix is to move the sequence point in the compiler's code generation.

Where are F# sequence points emitted in the compiler?

Sequence points are emitted in `src/Compiler/CodeGen/IlxGen.fs`, specifically in `EmitDebugPoint` and `EnsureNopBetweenDebugPoints`. PDB writing is handled in `src/Compiler/AbstractIL/ilwritepdb.fs`.

Can I fix breakpoint issues by adding NOP instructions at runtime?

No. The core rule is to move the sequence point to a valid stack-empty IL offset rather than adding runtime instructions, which would change program behavior and generated code.

How do I build the F# compiler for debugging work?

Run `Build.cmd -c Debug` from the repository root to produce a Debug build. You can also configure a local compiler setup using `UseLocalCompiler.Directory.Build.props`.