Debugger (DAP)

Breakpoint debugging via the Debug Adapter Protocol.

bin/penelope-dap speaks the standard Debug Adapter Protocol over stdio. Any DAP-compatible editor (VSCode, Neovim's nvim-dap) can drive a Penelope debugging session.

What works

What does not work yet

VSCode

Install the extension in dev mode (see vscode-extension/README). Open a .pen file → Run and Debug → "Launch Penelope file".

{
  "type": "penelope",
  "request": "launch",
  "name": "Launch Penelope file",
  "program": "${workspaceFolder}/${file}"
}

Neovim (nvim-dap)

local dap = require('dap')
dap.adapters.penelope = {
  type = 'executable',
  command = 'bin/penelope-dap',
  args = {},
}
dap.configurations.penelope = {
  {
    type = 'penelope',
    request = 'launch',
    name = 'Launch Penelope file',
    program = '${workspaceFolder}/${relativeFile}',
  },
}

Protocol details

The adapter understands these DAP requests: initialize, launch, setBreakpoints, configurationDone, continue, next, stepIn, stepOut, restart, threads, stackTrace, scopes, variables, terminate, disconnect. Emits events: initialized, stopped (reasons: entry, breakpoint, step, pause), output, terminated.

The wire format is identical to LSP — Content-Length-framed JSON-RPC over stdio.