VS Code tutorial

Twelve chapters, in the order you would actually hit them: get the project compiled so the debugger has something to read, get a session running, then work outward through breakpoints, exceptions, state inspection, and the things that only show up on bigger targets.

Before you start

Two prerequisites, both covered elsewhere:

  • The debugger installed and the delphi-win64 debug type available in your editor — see Getting started.
  • The program you want to debug compiled with full debug information. This is the one that catches people out: without it there are no source lines, and without source lines there are no breakpoints and no stepping. Chapter 1 is entirely about getting this right.

The tutorial assumes you already know how to use a debugger. It explains what this one does, where it differs from what you expect, and where it deliberately refuses to guess.

It does not assume you know Visual Studio Code. If twenty years of Delphi is what you are bringing, read chapter 0 first: it is a translation table, not an editor tutorial, and it takes five minutes.

The chapters

Setting up

  • 0. VS Code for Delphi developers — start here if VS Code is new to you. Which key does what now (two of them are swapped), where the debug windows went, and the settings a Delphi codebase needs before the editor behaves.
  • 1. Preparing your project — the compiler and linker settings the debugger needs, what each debug-info artefact buys you, and the launch.json configuration.

Running and stopping

  • 2. Your first session — the Run and Debug view, starting and stopping, and what each stepping command actually does.
  • 3. Breakpoints — all of them: conditional, hit count, logpoints, address breakpoints, hardware watchpoints, Set Next Statement.
  • 4. Exception handling — the four filters, and the rule engine you need once the codebase raises handled exceptions in a loop.

Reading the state

Real projects

Reference

Not in this tutorial

Driving the debugger from an AI coding agent is its own section — MCP & AI agents. How the engine is built, for anyone reading or extending the source, is in Architecture.